From owner-cvs-src@FreeBSD.ORG Thu Sep 23 21:49:53 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 E266516A4CF for ; Thu, 23 Sep 2004 21:49:53 +0000 (GMT) Received: from mail2.speakeasy.net (mail2.speakeasy.net [216.254.0.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80AC043D4C for ; Thu, 23 Sep 2004 21:49:53 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 1825 invoked from network); 23 Sep 2004 21:49:53 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 23 Sep 2004 21:49:52 -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 i8NLngV9012117; Thu, 23 Sep 2004 17:49:43 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Joerg Wunsch Date: Thu, 23 Sep 2004 17:48:19 -0400 User-Agent: KMail/1.6.2 References: <200409232112.i8NLCLgQ065917@repoman.freebsd.org> In-Reply-To: <200409232112.i8NLCLgQ065917@repoman.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200409231748.19685.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: cvs-src@FreeBSD.org cc: src-committers@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: Thu, 23 Sep 2004 21:49:54 -0000 On Thursday 23 September 2004 05:12 pm, Joerg Wunsch wrote: > joerg 2004-09-23 21:12:21 UTC > > FreeBSD src repository > > Modified files: > sys/dev/fdc fdc.c fdcvar.h > Log: > Implement terminating the worker thread when the driver is about to > be deregistered. > > Not yet tested, since by now, GEOM doesn't want us to deregister. PHK > wants to fix that RSN. Note that relying on a wakeup from your own code is not safe if you expect fdc to be a module since you could wakeup the thread doing the kldunload (and thus detach) and then be interrupted for an interrupt and it could unmap the memory backing that function before you get a chance to run again resulting in a panic. There is a special wakeup on the proc pointer in exit1() for kthreads to handle this case. I should likely move that into kthread_exit() however (which wouldn't be a functional change as far as you are concerned). -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org