[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.01.0908181937400.3158@localhost.localdomain>
Date: Tue, 18 Aug 2009 19:40:16 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Kumar Gala <galak@...nel.crashing.org>
cc: Steven Rostedt <rostedt@...dmis.org>, linux-kernel@...r.kernel.org,
mingo@...e.hu, tglx@...utronix.de, linuxppc-dev@...abs.org,
peterz@...radead.org
Subject: Re: [PATCH] spinlock: __raw_spin_is_locked() should return true for
UP
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists