From owner-freebsd-arch@FreeBSD.ORG Mon Oct 4 15:33:31 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 84D5C16A4CE for ; Mon, 4 Oct 2004 15:33:31 +0000 (GMT) Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id C50B443D6D for ; Mon, 4 Oct 2004 15:33:30 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 3041 invoked from network); 4 Oct 2004 15:33:29 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 4 Oct 2004 15:33:29 -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 i94FXOo2056806; Mon, 4 Oct 2004 11:33:25 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-arch@FreeBSD.org Date: Mon, 4 Oct 2004 11:31:35 -0400 User-Agent: KMail/1.6.2 References: <1095468747.31297.241.camel@palm.tree.com> <1096496057.3733.2163.camel@palm.tree.com> <1096603981.21577.195.camel@palm.tree.com> In-Reply-To: <1096603981.21577.195.camel@palm.tree.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200410041131.35387.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Peter Holm cc: "freebsd-arch@freebsd.org" cc: Julian Elischer cc: Stephan Uphoff Subject: Re: scheduler (sched_4bsd) questions X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Oct 2004 15:33:31 -0000 On Friday 01 October 2004 12:13 am, Stephan Uphoff wrote: > On Wed, 2004-09-29 at 18:14, Stephan Uphoff wrote: > > I was looking at the MUTEX_WAKE_ALL undefined case when I used the > > critical section for turnstile_claim(). > > However there are bigger problems with MUTEX_WAKE_ALL undefined > > so you are right - the critical section for turnstile_claim is pretty > > useless. > > Arghhh !!! > > MUTEX_WAKE_ALL is NOT an option in GENERIC. > I recall verifying that it is defined twice. Guess I must have looked at > the wrong source tree :-( > This means yes - we have bigger problems! > > Example: > > Thread A holds a mutex x contested by Thread B and C and has priority > pri(A). > > Thread C holds a mutex y and pri(B) < pri(C) > > Thread A releases the lock wakes thread B but lets C on the turnstile > wait queue. > > An interrupt thread I tries to lock mutex y owned by C. > > However priority inheritance does not work since B needs to run first to > take ownership of the lock. > > I is blocked :-( Ermm, if the interrupt happens after x is released then I's priority should propagate from I to C to B. If the interrupt happens before x is released, then the final bit of propagate_priority() should handle it since it resorts the turnstile's thread queue so that C will be awakened rather than B. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org