From owner-freebsd-current@FreeBSD.ORG Wed May 24 21:49:15 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E8AD416A579 for ; Wed, 24 May 2006 21:49:15 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5967243D46 for ; Wed, 24 May 2006 21:49:15 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from [10.0.1.114] (nat-outside.atlanta.corp.yahoo.com [63.172.193.57]) (authenticated bits=0) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k4OLnEb0095945 for ; Wed, 24 May 2006 17:49:14 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: current@freebsd.org Date: Wed, 24 May 2006 17:49:02 -0400 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200605241749.02885.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1480/Wed May 24 12:45:51 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.1 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: Subject: [PATCH] Fixup locking for kernel-linker, needs ndis testing(!) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 May 2006 21:49:17 -0000 I've reworked the locking for the kernel linker to convert the existing kld_mtx to an sx lock and extend it's scope to cover all of the various linker-related data structures. I also changed the kernel linker API a bit to make it more amenable to locking in that I added a 'linker_file_foreach' that iterates over the list of linker files calling a supplied predicate function and made the functions to lookup a linker file by name or index private. This meant that the ndis and hwpmc code had to stop fondling the kernel linker internals. I also made the VFS Giant locking in ndis and the kernel linker conditional such that it only locks Giant for non-MPSAFE filesystems. I have runtested this patch a while back, but the ndis and hwpmc parts have only been compile tested. Please test. http://www.FreeBSD.org/~jhb/patches/kld.patch -- John Baldwin