From owner-cvs-src@FreeBSD.ORG Wed Jun 21 20:42:08 2006 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F05B316A474; Wed, 21 Jun 2006 20:42:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C050D43D48; Wed, 21 Jun 2006 20:42:08 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k5LKg8GL030034; Wed, 21 Jun 2006 20:42:08 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k5LKg8vA030033; Wed, 21 Jun 2006 20:42:08 GMT (envelope-from jhb) Message-Id: <200606212042.k5LKg8vA030033@repoman.freebsd.org> From: John Baldwin Date: Wed, 21 Jun 2006 20:42:08 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern kern_linker.c link_elf.c link_elf_obj.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jun 2006 20:42:09 -0000 jhb 2006-06-21 20:42:08 UTC FreeBSD src repository Modified files: sys/kern kern_linker.c link_elf.c link_elf_obj.c Log: Replace the kld_mtx mutex with a kld_sx sx lock and expand it's scope to protect all linker-related data structures including the contents of linker file objects and the any linker class data as well. Considering how rarely the linker is used I just went with the simple solution of single-threading the whole thing rather than expending a lot of effor on something more fine-grained and complex. Giant is still explicitly acquired while registering and deregistering sysctl's as well as in the elf linker class while calling kmupetext(). The rest of the linker runs without Giant unless it has to acquire Giant while loading files from a non-MPSAFE filesystem. Revision Changes Path 1.138 +76 -49 src/sys/kern/kern_linker.c 1.89 +2 -2 src/sys/kern/link_elf.c 1.92 +0 -2 src/sys/kern/link_elf_obj.c