From owner-cvs-src@FreeBSD.ORG Fri Jun 30 19:14:44 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 6086E16A403; Fri, 30 Jun 2006 19:14:44 +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 294AA43D48; Fri, 30 Jun 2006 19:14:41 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k5UJERpl046290; Fri, 30 Jun 2006 15:14:27 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Warner Losh Date: Fri, 30 Jun 2006 14:57:37 -0400 User-Agent: KMail/1.9.1 References: <200606261834.k5QIYkEF005337@repoman.freebsd.org> <200606270848.29250.jhb@freebsd.org> <20060629.235856.74667657.imp@bsdimp.com> In-Reply-To: <20060629.235856.74667657.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200606301457.38376.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 30 Jun 2006 15:14:28 -0400 (EDT) X-Virus-Scanned: ClamAV 0.87.1/1578/Fri Jun 30 05:34:32 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: sam@errno.com, src-committers@freebsd.org, cvs-all@freebsd.org, cvs-src@freebsd.org Subject: Re: cvs commit: src/sys/kern kern_module.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: Fri, 30 Jun 2006 19:14:44 -0000 On Friday 30 June 2006 01:58, Warner Losh wrote: > From: John Baldwin > Subject: Re: cvs commit: src/sys/kern kern_module.c > Date: Tue, 27 Jun 2006 08:48:28 -0400 > > > On Monday 26 June 2006 19:41, Sam Leffler wrote: > > > John Baldwin wrote: > > > > jhb 2006-06-26 18:34:45 UTC > > > > > > > > FreeBSD src repository > > > > > > > > Modified files: > > > > sys/kern kern_module.c > > > > Log: > > > > Address a problem I missed in removing Giant from the kernel linker. Not > > > > all of the module event handlers are MP safe yet, so always acquire Giant > > > > for now when invoking module event handlers. Eventually we can add an > > > > MPSAFE flag or some such and add appropriate locking to all module event > > > > handlers. > > > > > > I suggest we should be marking things !MPSAFE rather than MPSAFE. > > > > > > Sam > > > > I would prefer that as well but that would require an exhaustive search of > > all existing module event handlers to determine MPSAFE-ness up front. With > > the mark as MPSAFE method (such as we've used for syscalls) we can mark things > > MPSAFE (and/or add locking to make them MPSAFE) while doing the exhaustive > > search and eventually when all are MPSAFE we can remove the flag (which I'm > > in the process of doing now with the syscall flag) all the while having a > > functioning system. > > We have three cases right now: > > (1) Unknown > (2) MPSAFE > (3) NEEDS GIANT > > All the unknown ones need giant right now, or at least that's a > reasonable guess. Certainly all the device driver ones do since you > need giant to do certain device tree activities. > > Short of introducing a new API, I'm unsure how we'd be able to > effectively and safely do NEEDS_GIANT marking in the interrum. DECLARE_MODULE_MPSAFE() or some such is how one would do it, but for now they are all in the (1) category. -- John Baldwin