From owner-cvs-all@FreeBSD.ORG Thu Sep 15 21:27:22 2005 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4657C16A41F; Thu, 15 Sep 2005 21:27:22 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id C385043D46; Thu, 15 Sep 2005 21:27:19 +0000 (GMT) (envelope-from scottl@samsco.org) Received: from [192.168.254.11] (junior.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.13.4/8.13.4) with ESMTP id j8FLRIkT002318; Thu, 15 Sep 2005 15:27:18 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <4329E739.4070707@samsco.org> Date: Thu, 15 Sep 2005 15:27:21 -0600 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.8) Gecko/20050615 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <200509151905.j8FJ5beJ008055@repoman.freebsd.org> <20050915205233.GA23141@garage.freebsd.pl> In-Reply-To: <20050915205233.GA23141@garage.freebsd.pl> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=3.8 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on pooker.samsco.org Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org, John Baldwin Subject: Re: cvs commit: src/sys/kern kern_intr.c subr_sleepqueue.c src/sys/geom geom_io.c src/sys/sys proc.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2005 21:27:22 -0000 Pawel Jakub Dawidek wrote: > On Thu, Sep 15, 2005 at 07:05:37PM +0000, John Baldwin wrote: > +> jhb 2005-09-15 19:05:37 UTC > +> > +> FreeBSD src repository > +> > +> Modified files: > +> sys/kern kern_intr.c subr_sleepqueue.c > +> sys/geom geom_io.c > +> sys/sys proc.h > +> Log: > +> - Add a new simple facility for marking the current thread as being in a > +> state where sleeping on a sleep queue is not allowed. The facility > +> doesn't support recursion but uses a simple private per-thread flag > +> (TDP_NOSLEEPING). The sleepq_add() function will panic if the flag is > +> set and INVARIANTS is enabled. > +> - Use this new facility to replace the g_xup and g_xdown mutexes that were > +> (ab)used to achieve similar behavior. > > So is this still possible to use mutexes in I/O paths (g_up/g_down threads) > or it will panic immediatelly? > > The policy for now was: using mutexes in a sane way is possible. > The question is: did we went from a warning when WITNESS is enabled to > a panic with INVARIANTS only? > Well, there is a subtle distinction here that isn't well understood. Sleep mutexes "block", they don't "sleep". "Sleeping" implies that scheduling is lost for the thread for an unbounded period of time. "Blocking" implies that scheduling is lost for a relatively short and bounded period of time. So yes, sleep mutexes are still allowed. Scott