From owner-cvs-all@FreeBSD.ORG Tue Jul 13 19:55:48 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0107416A4CE; Tue, 13 Jul 2004 19:55:48 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7EA2E43D45; Tue, 13 Jul 2004 19:55:47 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from [192.168.0.12] (g4.samsco.home [192.168.0.12]) (authenticated bits=0) by pooker.samsco.org (8.12.11/8.12.10) with ESMTP id i6DK1Aef028483; Tue, 13 Jul 2004 14:01:10 -0600 (MDT) (envelope-from scottl@freebsd.org) Message-ID: <40F43DFE.3000402@freebsd.org> Date: Tue, 13 Jul 2004 13:54:38 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040514 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nate Lawson References: <20040713193703.ECB0016A53F@hub.freebsd.org> <40F43D36.2000407@root.org> In-Reply-To: <40F43D36.2000407@root.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=0.0 required=3.8 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on pooker.samsco.org cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: Poul-Henning Kamp cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/sbin/kldunload kldunload.8 kldunload.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jul 2004 19:55:48 -0000 Nate Lawson wrote: > Poul-Henning Kamp wrote: > >> Give kldunload a -f(orce) argument. >> Add a MOD_QUIESCE event for modules. This should return error >> (EBUSY) >> of the module is in use. >> MOD_UNLOAD should now only fail if it is impossible (as opposed to >> inconvenient) to unload the module. Valid reasons are memory >> references >> into the module which cannot be tracked down and eliminated. >> When kldunloading, we abandon if MOD_UNLOAD fails, and if -force is >> not given, MOD_QUIESCE failing will also prevent the unload. > > > Hmmm, a quick check of the archives shows that I missed your discussion > of this on Thursday/Friday when I was on vacation. (Including the > extremely useful naming replies!) > > Have you kept up on the newbus discussions? The tentative plan was to > add quiesce functionality to it as part of device_detach(). Doing it at > the module layer is a bit too low since there are events that can > trigger a detach but not an unload. For instance, any driver compiled > into the kernel for an ejectable device will never be unloaded, but > certainly should quiesce/detach when the device is ejected. Getting it > right in newbus automatically fixes the problem you're trying to solve > since a module unload always triggers a call to device_detach() but not > vice versa. > > I think duplicating this at multiple layers is not a good idea and the > module level is not the right layer to implement it. > It typically won't be duplicated. This particular work is good for things like GEOM modules that don't fit into newbus. If at some point in the future newbus becomes aware of pseudo-drivers (drivers not attached by a hardware bus) then this should indeed be revisited. Scott