From owner-cvs-src@FreeBSD.ORG Fri Sep 24 01:10:40 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 41AF716A4CE; Fri, 24 Sep 2004 01:10:40 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id D0A7943D55; Fri, 24 Sep 2004 01:10:39 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (harmony.village.org [10.0.0.6]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id i8O1A7d7023225; Thu, 23 Sep 2004 19:10:07 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Thu, 23 Sep 2004 19:11:14 -0600 (MDT) Message-Id: <20040923.191114.00483229.imp@bsdimp.com> To: nate@root.org From: "M. Warner Losh" In-Reply-To: <41535BD3.1020609@root.org> References: <41535A06.7090809@root.org> <200409231923.40285.jhb@FreeBSD.org> <41535BD3.1020609@root.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: green@FreeBSD.org cc: src-committers@FreeBSD.org cc: jhb@FreeBSD.org cc: joerg@FreeBSD.org cc: cvs-src@FreeBSD.org cc: cvs-all@FreeBSD.org 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:10:40 -0000 In message: <41535BD3.1020609@root.org> Nate Lawson writes: : 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? Why have a suspended thread around when you could have it dead? It is a resource leak. Warner