From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751889AbZHSClf (ORCPT ); Tue, 18 Aug 2009 22:41:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751644AbZHSCle (ORCPT ); Tue, 18 Aug 2009 22:41:34 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:50685 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751587AbZHSCle (ORCPT ); Tue, 18 Aug 2009 22:41:34 -0400 Date: Tue, 18 Aug 2009 19:40:16 -0700 (PDT) From: Linus Torvalds X-X-Sender: torvalds@localhost.localdomain To: Kumar Gala cc: Steven Rostedt , linux-kernel@vger.kernel.org, mingo@elte.hu, tglx@linutronix.de, linuxppc-dev@ozlabs.org, peterz@infradead.org Subject: Re: [PATCH] spinlock: __raw_spin_is_locked() should return true for UP In-Reply-To: Message-ID: References: <1250635343-32546-1-git-send-email-galak@kernel.crashing.org> User-Agent: Alpine 2.01 (LFD 1184 2008-12-16) 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 On Tue, 18 Aug 2009, Kumar Gala wrote: > > I agree its a little too easy to abuse spin_is_locked. However we should be > consistent between spin_is_locked on UP between with and without > CONFIG_DEBUG_SPINLOCK enabled. No we shouldn't. With CONFIG_DEBUG_SPINLOCK, you have an actual lock variable for debugging purposes, so spin_is_locked() can clearly return a _valid_ answer, and should do so. Without DEBUG_SPINLOCK, there isn't any answer to return. So there's no way we can or should be consistent. In one case an answer exists, in another one the answer is meaningless and doesn't exist. > How much of this do we want to try and address in .31? Absolutely nothing. > The PPC test really should be using assert_spin_locked and I'll send a patch > to Ben for that. Yes, that's the correct fix. Linus