From owner-freebsd-current Tue Aug 8 0:51:15 2000 Delivered-To: freebsd-current@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id CCC3D37B69A for ; Tue, 8 Aug 2000 00:51:02 -0700 (PDT) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id e787p0r29468; Tue, 8 Aug 2000 00:51:00 -0700 (PDT) Date: Tue, 8 Aug 2000 00:51:00 -0700 From: Alfred Perlstein To: David Greenman Cc: current@FreeBSD.ORG Subject: Re: Ugly, slow shutdown Message-ID: <20000808005100.A4854@fw.wintelcom.net> References: <200008080238.TAA40871@vashon.polstra.com> <200008080558.WAA05458@implode.root.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i In-Reply-To: <200008080558.WAA05458@implode.root.com>; from dg@root.com on Mon, Aug 07, 2000 at 10:58:17PM -0700 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * David Greenman [000807 23:15] wrote: > >In article <200008080135.SAA04815@implode.root.com>, David Greenman > > wrote: > > >Obviously the waker-upper knows that the condition is true. Otherwise > >the existing code which doesn't check wouldn't work. In the expensive > >cases the waker-upper could simply set a flag for the sleeper to > >check. > > For me, that doesn't make the code easier to read or understand - it has > the opposite effect. ...but then I'm used to the historical symantics and > naturally consider the possible cases when looking at the code. > > >Note, I am not expressing an opinion about whether the sleeps should > >be terminated prematurely during shutdown. But I am expressing a > >strong opinion about whether sleepers should do a reality check before > >proceeding. > > I could be persuaded to think that way, but I still remain unconvinced. > Again, I'm used to the historical symantics, so changing them requires a > pretty good justification and a bit of brain rewiring, which I naturally > resist. It's not just that, if you always have to cover your behind when doing tsleep you may wind up masking wakeup bugs. Places like "vfs_bio.c" line 586 of 3182: bp->b_xflags |= BX_BKGRDWAIT; tsleep(&bp->b_xflags, PRIBIO, "biord", 0); if (bp->b_xflags & BX_BKGRDINPROG) panic("bwrite: still writing"); } If replaced by a while() _may_ obscure a buffercache bug. Personally I'd like to be able to catch such bugs than let them go because the API (wakeups can happen at any time) prohibits this. -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message