Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1763734AbZAGXSo (ORCPT ); Wed, 7 Jan 2009 18:18:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1763644AbZAGXQ5 (ORCPT ); Wed, 7 Jan 2009 18:16:57 -0500 Received: from smtp1.linux-foundation.org ([140.211.169.13]:45999 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760344AbZAGXQy (ORCPT ); Wed, 7 Jan 2009 18:16:54 -0500 Date: Wed, 7 Jan 2009 15:15:48 -0800 (PST) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Gregory Haskins cc: Andi Kleen , Matthew Wilcox , Steven Rostedt , Peter Zijlstra , paulmck@linux.vnet.ibm.com, Ingo Molnar , Chris Mason , Andrew Morton , Linux Kernel Mailing List , linux-fsdevel , linux-btrfs , Thomas Gleixner , Nick Piggin , Peter Morreale , Sven Dietrich Subject: Re: [PATCH -v5][RFC]: mutex: implement adaptive spinning In-Reply-To: <49652C7C.3000909@novell.com> Message-ID: References: <1231281801.11687.125.camel@twins> <1231283778.11687.136.camel@twins> <1231329783.11687.287.camel@twins> <1231347442.11687.344.camel@twins> <20090107210923.GV2002@parisc-linux.org> <20090107213924.GP496@one.firstfloor.org> <49652C7C.3000909@novell.com> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 971 Lines: 26 On Wed, 7 Jan 2009, Gregory Haskins wrote: > > Can I ask a simple question in light of all this discussion? > > "Is get_task_struct() really that bad?" Yes. It's an atomic access (two, in fact, since you need to release it too), which is a huge deal if we're talking about a timing-critical section of code. And this is timing-critical, or we wouldn't even care - even in the contention case. Admittedly btrfs apparently makes it more so that it _should_ be, but Peter had some timings that happened with just regular create/unlink that showed a big difference. So the whole and only point of spinning mutexes is to get rid of the scheduler overhead, but to also not replace it with some other thing ;) Linus -- 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/