From owner-freebsd-smp Mon Jun 26 14:56:58 2000 Delivered-To: freebsd-smp@freebsd.org Received: from magnesium.net (toxic.magnesium.net [207.154.84.15]) by hub.freebsd.org (Postfix) with SMTP id A8A1C37BBDE for ; Mon, 26 Jun 2000 14:56:51 -0700 (PDT) (envelope-from jasone@magnesium.net) Received: (qmail 73643 invoked by uid 1142); 26 Jun 2000 21:56:49 -0000 Date: 26 Jun 2000 14:56:49 -0700 Date: Mon, 26 Jun 2000 14:49:57 -0700 From: Jason Evans To: Luoqi Chen Cc: smp@FreeBSD.ORG Subject: Re: SMP meeting summary Message-ID: <20000626144957.J8965@blitz.canonware.com> References: <200006262013.e5QKDOP09679@lor.watermarkgroup.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <200006262013.e5QKDOP09679@lor.watermarkgroup.com>; from luoqi@watermarkgroup.com on Mon, Jun 26, 2000 at 04:13:24PM -0400 Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Mon, Jun 26, 2000 at 04:13:24PM -0400, Luoqi Chen wrote: > > Processes that block on a mutex are granted the lock in FIFO order, rather > > than priority order. In order to avoid priority inversion, the mutex wait > > queue implements priority lending. > > > Ok. I remember I have read somewhere that solaris 7 has given up the behavior > of waking up only one thread after a mutex is released, now it wakes up all > the blocking threads. It seems that the "thundering herd" problem is not > serious after all if the lock granuity is high enough. I don't think this is the case. Solaris uses what are called turnstiles to implement priority lending. For a reasonably detailed explanation, see: http://www.sunworld.com/sunworldonline/swol-08-1999/swol-08-insidesolaris.html My reading of this article is that turnstiles use priority lending to boost the current owner(s) of a lock, but that subsequent lock granting is done in priority order. This lock granting behavior isn't strictly necessary, but it may have desireable characteristics. I haven't looked at the BSD/OS code in detail yet, but according to Doug Rabson, it behaves in basically the same way. Also, there is a book due out within the next several weeks that contains a lot of good information about the Solaris kernel: Solaris Internals: Architecture and Techniques Vol. 1 Core Kernel Components by Jim Mauro, Richard McDougall ISBN: 0-13-022496-0 Jason To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message