From owner-cvs-src@FreeBSD.ORG Fri Sep 24 01:04:36 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 E191916A4CE; Fri, 24 Sep 2004 01:04:36 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8680643D53; Fri, 24 Sep 2004 01:04:36 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from pooker.samsco.org (scottl@localhost [127.0.0.1]) by pooker.samsco.org (8.12.11/8.12.10) with ESMTP id i8O14k4L042651; Thu, 23 Sep 2004 19:04:46 -0600 (MDT) (envelope-from scottl@freebsd.org) Received: from localhost (scottl@localhost)i8O14kxT042648; Thu, 23 Sep 2004 19:04:46 -0600 (MDT) (envelope-from scottl@freebsd.org) X-Authentication-Warning: pooker.samsco.org: scottl owned process doing -bs Date: Thu, 23 Sep 2004 19:04:46 -0600 (MDT) From: Scott Long Sender: scottl@pooker.samsco.org To: John Baldwin In-Reply-To: <200409232057.19962.jhb@FreeBSD.org> Message-ID: <20040923190353.L39925@pooker.samsco.org> References: <200409232112.i8NLCLgQ065917@repoman.freebsd.org> <200409231923.40285.jhb@FreeBSD.org> <41535BD3.1020609@root.org> <200409232057.19962.jhb@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: Brian Fundakowski Feldman cc: src-committers@freebsd.org cc: Joerg Wunsch cc: cvs-src@freebsd.org cc: cvs-all@freebsd.org cc: Nate Lawson 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:04:37 -0000 On Thu, 23 Sep 2004, John Baldwin wrote: > 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. > It would be really sad if we _designed_ FreeBSD to leak threads. Windows stopped doing that back with Win98. We're better than that. Scott