From owner-freebsd-arch@FreeBSD.ORG Sat Aug 9 21:02:33 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68DA6106568D for ; Sat, 9 Aug 2008 21:02:33 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 085DB8FC21 for ; Sat, 9 Aug 2008 21:02:32 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [IPv6:2001:470:1f11:75:2a0:d2ff:fe18:8b38]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m79L1w7O043547 for ; Sat, 9 Aug 2008 17:02:26 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: arch@freebsd.org Date: Sat, 9 Aug 2008 16:37:33 -0400 User-Agent: KMail/1.9.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200808091637.33820.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [IPv6:2001:470:1f11:75::1]); Sat, 09 Aug 2008 17:02:26 -0400 (EDT) X-Virus-Scanned: ClamAV 0.93.1/7995/Sat Aug 9 14:55:20 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,NO_RELAYS autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Subject: Make MOD_QUIESCE a bit more useful.. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Aug 2008 21:02:33 -0000 So currently the MOD_QUIESCE event is posted to a module when unloading a kld so it can veto non-forced unloads. However, the current implementation in the kernel linker is to run through all the modules in a file, posting MOD_QUIESCE followed by MOD_UNLOAD on each module serially. Thus, if you have multiple modules in a single kld and one of the modules veto's an unload request via MOD_QUIESCE, you don't know as the module author if any of your modules were unloaded via MOD_UNLOAD or not. I think a better approach would be to change the kernel linker to invoke MOD_QUIESCE on all modules in a single pass first. If none of those fail (or it's a forced unload), then it can do a second pass invoking MOD_UNLOAD on all the modules. -- John Baldwin