From owner-cvs-src@FreeBSD.ORG Fri Sep 24 01:01:12 2004 Return-Path: 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 18A5316A4D0 for ; Fri, 24 Sep 2004 01:01:12 +0000 (GMT) Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id AE24E43D41 for ; Fri, 24 Sep 2004 01:01:11 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 15818 invoked from network); 24 Sep 2004 01:01:09 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 24 Sep 2004 01:01:08 -0000 Received: from [10.50.40.210] (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i8O10tSO013415; Thu, 23 Sep 2004 21:00:57 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Nate Lawson Date: Thu, 23 Sep 2004 20:57:19 -0400 User-Agent: KMail/1.6.2 References: <200409232112.i8NLCLgQ065917@repoman.freebsd.org> <200409231923.40285.jhb@FreeBSD.org> <41535BD3.1020609@root.org> In-Reply-To: <41535BD3.1020609@root.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200409232057.19962.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Brian Fundakowski Feldman cc: src-committers@FreeBSD.org cc: cvs-src@FreeBSD.org cc: cvs-all@FreeBSD.org cc: Joerg Wunsch Subject: Re: cvs commit: src/sys/dev/fdc fdc.c fdcvar.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 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, 24 Sep 2004 01:01:12 -0000 On Thursday 23 September 2004 07:27 pm, Nate Lawson wrote: > John Baldwin wrote: > > On Thursday 23 September 2004 07:19 pm, Nate Lawson wrote: > >>Or simpler: > >> > >>foo_kill(): > >> error = kthread_suspend(p, kproc_shutdown_wait * hz); > >> if (error == EWOULDBLOCK) > >> printf("timed out\n"); > >> > >>foo_thread(): > >> for (;;) { > >> mtx_unlock(&bdlock); > >> kthread_suspend_check(bufdaemonproc); > >> ... > >> mtx_lock(&bdlock); > >> if (numdirtybuffers <= lodirtybuffers) > >> msleep(&bd_request, &bdlock, PVM, "psleep", hz); > > > > That doesn't actually cause the thread to exit, it just goes to sleep. > > If fdc wants to support detaching and kldunload it needs the thread to > > actually go away, not just go to sleep. > > If a thread is suspended and the module is unloaded, what would be the > failure case? Leaving unclaimed KVM around that can never be recovered. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org