Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756047AbZAMQjs (ORCPT ); Tue, 13 Jan 2009 11:39:48 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753220AbZAMQjg (ORCPT ); Tue, 13 Jan 2009 11:39:36 -0500 Received: from mx3.mail.elte.hu ([157.181.1.138]:36106 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752840AbZAMQjf (ORCPT ); Tue, 13 Jan 2009 11:39:35 -0500 Date: Tue, 13 Jan 2009 17:39:07 +0100 From: Ingo Molnar To: Peter Zijlstra Cc: Linus Torvalds , "Paul E. McKenney" , Gregory Haskins , Matthew Wilcox , Andi Kleen , Chris Mason , Andrew Morton , Linux Kernel Mailing List , linux-fsdevel , linux-btrfs , Thomas Gleixner , Nick Piggin , Peter Morreale , Sven Dietrich , Dmitry Adamushko Subject: Re: [PATCH -v9][RFC] mutex: implement adaptive spinning Message-ID: <20090113163907.GA24996@elte.hu> References: <1231774622.4371.96.camel@laptop> <1231859742.442.128.camel@twins> <1231863710.7141.3.camel@twins> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1231863710.7141.3.camel@twins> User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.3 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1158 Lines: 30 * Peter Zijlstra wrote: > > Now you're forcing the slow-path on unlock. Maybe it was intentional, > > maybe it wasn't. Did you perhaps mean > > > > if (atomic_cmpxchg(&lock->count, 1, 0) == 1) { > > > > here? I thought we agreed it was safe, if only because it should be > > equivalent to just having done "mutex_trylock()" instead of a "real" > > lock sequence. > > Yes, that was an 'accident' from -v8, yes we did think the cmpxchg was > good, however I did get some spurious lockups on -v7, and I only noticed > the thing after I'd done most of the testing, so I decided to let it be > for now. > > Let me put the cmpxchg back in and see if this is all still good (only > 3*2*2 configs to test :-). i saw sporadic lockups with -v7 too, so if you send a -v10 with Linus's sequence for the unlock it takes about an hour of testing to check whether it still occurs. Ingo -- 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/