Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756093AbYFWUj7 (ORCPT ); Mon, 23 Jun 2008 16:39:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753674AbYFWUjw (ORCPT ); Mon, 23 Jun 2008 16:39:52 -0400 Received: from viefep11-int.chello.at ([62.179.121.31]:61557 "EHLO viefep11-int.chello.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753283AbYFWUjv (ORCPT ); Mon, 23 Jun 2008 16:39:51 -0400 Subject: Re: Spinlocks: Factor our GENERIC_LOCKBREAK in order to avoid spin with irqs disable From: Peter Zijlstra To: Christoph Lameter Cc: Petr Tesarik , Ingo Molnar , linux-kernel@vger.kernel.org In-Reply-To: References: <20080507073017.GJ32195@elte.hu> <1214241561.19392.21.camel@elijah.suse.cz> Content-Type: text/plain Date: Mon, 23 Jun 2008 22:39:53 +0200 Message-Id: <1214253593.11254.30.camel@twins> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1064 Lines: 26 On Mon, 2008-06-23 at 11:20 -0700, Christoph Lameter wrote: > On Mon, 23 Jun 2008, Petr Tesarik wrote: > > > Maybe I'm just blind, but doesn't this change effectively disable any > > arch-specific optimized code for _raw_*_lock? > > True. Only the __raw_xxx_trylock is still used. > > > If CONFIG_DEBUG_LOCK_ALLOC is set, then CONFIG_DEBUG_SPINLOCK must also > > be set, so in that case the debugging versions of _raw_*_lock are used. > > But if CONFIG_DEBUG_LOCK_ALLOC is _not_ set, then the locks are built > > with _trylock and _can_lock primitives. > > > > What am I missing here? > > It is good that the locks are build with _trylock and _can_lock because > then we can reenable interrupts while spinning. Well, good and bad, the turn side is that fairness schemes like ticket locks are utterly defeated. -- 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/