From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Mason Subject: Re: [GIT PULL] adaptive spinning mutexes Date: Wed, 14 Jan 2009 13:40:46 -0500 Message-ID: <1231958447.8269.30.camel@think.oraclecorp.com> References: <1231774622.4371.96.camel@laptop> <1231859742.442.128.camel@twins> <1231863710.7141.3.camel@twins> <1231864854.7141.8.camel@twins> <1231867314.7141.16.camel@twins> <1231952436.14825.28.camel@laptop> <20090114183319.GA18630@elte.hu> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Linus Torvalds , Peter Zijlstra , "Paul E. McKenney" , Gregory Haskins , Matthew Wilcox , Andi Kleen , Andrew Morton , Linux Kernel Mailing List , linux-fsdevel , linux-btrfs , Thomas Gleixner , Nick Piggin , Peter Morreale , Sven Dietrich , Dmitry Adamushko , Johannes Weiner To: Ingo Molnar Return-path: Received: from acsinet12.oracle.com ([141.146.126.234]:21700 "EHLO acsinet12.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752845AbZANSlt (ORCPT ); Wed, 14 Jan 2009 13:41:49 -0500 In-Reply-To: <20090114183319.GA18630@elte.hu> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, 2009-01-14 at 19:33 +0100, Ingo Molnar wrote: > * Peter Zijlstra wrote: > > > Full series, including changelogs available at: > > > > http://programming.kicks-ass.net/kernel-patches/mutex-adaptive-spin/ > > > > and should shortly appear in a git tree near Ingo :-) > > Linus, > > Please pull the adaptive-mutexes-for-linus git tree from: > > git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git adaptive-mutexes-for-linus > I was going to put this into the btrfs tree, but since you have a branch just for adaptive mutexes, is it easier to put there? From: Chris Mason Btrfs: stop spinning on mutex_trylock and let the adaptive code spin for us Mutexes now spin internally and the btrfs spin is no longer required for performance. Signed-off-by: Chris Mason diff --git a/fs/btrfs/locking.c b/fs/btrfs/locking.c index 39bae77..40ba8e8 100644 --- a/fs/btrfs/locking.c +++ b/fs/btrfs/locking.c @@ -37,16 +37,6 @@ int btrfs_tree_lock(struct extent_buffer *eb) { - int i; - - if (mutex_trylock(&eb->mutex)) - return 0; - for (i = 0; i < 512; i++) { - cpu_relax(); - if (mutex_trylock(&eb->mutex)) - return 0; - } - cpu_relax(); mutex_lock_nested(&eb->mutex, BTRFS_MAX_LEVEL - btrfs_header_level(eb)); return 0; }