Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932241AbVLUGVL (ORCPT ); Wed, 21 Dec 2005 01:21:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932285AbVLUGVL (ORCPT ); Wed, 21 Dec 2005 01:21:11 -0500 Received: from mx3.mail.elte.hu ([157.181.1.138]:43686 "EHLO mx3.mail.elte.hu") by vger.kernel.org with ESMTP id S932241AbVLUGVJ (ORCPT ); Wed, 21 Dec 2005 01:21:09 -0500 Date: Wed, 21 Dec 2005 07:20:25 +0100 From: Ingo Molnar To: Nick Piggin Cc: Nicolas Pitre , David Woodhouse , Zwane Mwaikambo , lkml , Linus Torvalds , Andrew Morton , Arjan van de Ven , Steven Rostedt , Alan Cox , Christoph Hellwig , Andi Kleen , David Howells , Alexander Viro , Oleg Nesterov , Paul Jackson Subject: Re: [patch 04/15] Generic Mutex Subsystem, add-atomic-call-func-x86_64.patch Message-ID: <20051221062025.GA32711@elte.hu> References: <20051219013507.GE27658@elte.hu> <1135025932.4760.1.camel@localhost.localdomain> <20051220043109.GC32039@elte.hu> <43A7BCE1.7050401@yahoo.com.au> <43A81132.8040703@yahoo.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43A81132.8040703@yahoo.com.au> User-Agent: Mutt/1.4.2.1i X-ELTE-SpamScore: 0.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=0.0 required=5.9 tests=AWL autolearn=no SpamAssassin version=3.0.3 0.0 AWL AWL: From: address is in the auto white-list X-ELTE-VirusStatus: clean Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1236 Lines: 34 * Nick Piggin wrote: > >>Considering that on UP, the arm should not need to disable interrupts > >>for this function (or has someone refuted Linus?), how about: > > > >Kernel preemption. > > preempt_disable() ? please take a look at kernel/mutex.c, there's a define at the top of the file: // #define MUTEX_IRQ_SAFE which, if off, makes the mutex code use preempt_disable() and preempt_enable() to make it preemption-safe. If it's on, the mutex implementation uses IRQ flags. in my current tree i've already eliminated this define, and have switched the code to use preempt_disable()/preempt_enable() exclusively, because preempt_*() is equally fast on all platforms, while IRQ disable costs vary largely. (and they are rarely faster than preempt_disable()). my current tree also provides a mechanism for architectures to hand-code the mutex lock and unlock fastpath, if they choose to do so. So i think we can really stop the cycle counting. 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/