From owner-freebsd-arch@FreeBSD.ORG Fri Oct 1 04:18:27 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 6EF9416A4CE for ; Fri, 1 Oct 2004 04:18:27 +0000 (GMT) Received: from duchess.speedfactory.net (duchess.speedfactory.net [66.23.201.84]) by mx1.FreeBSD.org (Postfix) with SMTP id 13E2A43D5A for ; Fri, 1 Oct 2004 04:18:26 +0000 (GMT) (envelope-from ups@tree.com) Received: (qmail 18303 invoked by uid 89); 1 Oct 2004 04:13:04 -0000 Received: from duchess.speedfactory.net (66.23.201.84) by duchess.speedfactory.net with SMTP; 1 Oct 2004 04:13:04 -0000 Received: (qmail 18222 invoked by uid 89); 1 Oct 2004 04:13:02 -0000 Received: from unknown (HELO palm.tree.com) (66.23.216.49) by duchess.speedfactory.net with SMTP; 1 Oct 2004 04:13:02 -0000 Received: from [127.0.0.1] (localhost.tree.com [127.0.0.1]) by palm.tree.com (8.12.10/8.12.10) with ESMTP id i914D1mt024697; Fri, 1 Oct 2004 00:13:01 -0400 (EDT) (envelope-from ups@tree.com) From: Stephan Uphoff To: John Baldwin In-Reply-To: <1096496057.3733.2163.camel@palm.tree.com> References: <1095468747.31297.241.camel@palm.tree.com> <1096477932.3733.1471.camel@palm.tree.com> <1096489576.3733.1868.camel@palm.tree.com> <200409291652.29990.jhb@FreeBSD.org> <1096496057.3733.2163.camel@palm.tree.com> Content-Type: text/plain Message-Id: <1096603981.21577.195.camel@palm.tree.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Fri, 01 Oct 2004 00:13:01 -0400 Content-Transfer-Encoding: 7bit cc: Peter Holm cc: Julian Elischer cc: "freebsd-arch@freebsd.org" 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: Fri, 01 Oct 2004 04:18:27 -0000 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 :-( This was found using Peter Holm's test and a slight modification of this giant hog detector. (kern_clock.diff) I definitely won't have time to fix kern_mutex.c for the next few days so please add the line: options MUTEX_WAKE_ALL # Needed do not remove to your configuration files. I also had overlooked http://www.holm.cc/stress/log/cons80.html Showing that my patch for kern_switch.c (switch_patch) has a bug. I will send an updated patch later today. Stephan PS: I love the firewire debugging speed!