Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756567AbZAIJaW (ORCPT ); Fri, 9 Jan 2009 04:30:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755076AbZAIJ3J (ORCPT ); Fri, 9 Jan 2009 04:29:09 -0500 Received: from casper.infradead.org ([85.118.1.10]:42457 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754290AbZAIJ24 (ORCPT ); Fri, 9 Jan 2009 04:28:56 -0500 Subject: Re: [PATCH -v7][RFC]: mutex: implement adaptive spinning From: Peter Zijlstra To: Linus Torvalds Cc: Chris Mason , Steven Rostedt , Ingo Molnar , paulmck@linux.vnet.ibm.com, Gregory Haskins , Matthew Wilcox , Andi Kleen , Andrew Morton , Linux Kernel Mailing List , linux-fsdevel , linux-btrfs , Thomas Gleixner , Nick Piggin , Peter Morreale , Sven Dietrich In-Reply-To: References: <1231441350.14304.48.camel@think.oraclecorp.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Fri, 09 Jan 2009 10:28:25 +0100 Message-Id: <1231493305.11687.528.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.24.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 984 Lines: 25 On Thu, 2009-01-08 at 11:13 -0800, Linus Torvalds wrote: > > On Thu, 8 Jan 2009, Chris Mason wrote: > > > > It is less fair though, the 50 proc parallel creates had a much bigger > > span between the first and last proc's exit time. This isn't a huge > > shock, I think it shows the hot path is closer to a real spin lock. > > Actually, the real spin locks are now fair. We use ticket locks on x86. > We _could_ certainly aim for using ticket locks for mutexes too, that > might be quite nice. Not really, ticket locks cannot handle a spinner going away - and we need that here. I've googled around a bit and MCS locks (http://www.cs.rice.edu/~johnmc/papers/asplos91.pdf) look like a viable way to gain fairness in our situation. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/