From: Kumar Gala <galak@kernel.crashing.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: peterz@infradead.org, linux-kernel@vger.kernel.org,
rostedt@goodmis.org, linuxppc-dev@ozlabs.org, mingo@elte.hu,
tglx@linutronix.de
Subject: [PATCH] spinlock: __raw_spin_is_locked() should return true for UP
Date: Tue, 18 Aug 2009 17:42:23 -0500 [thread overview]
Message-ID: <1250635343-32546-1-git-send-email-galak@kernel.crashing.org> (raw)
For some reason __raw_spin_is_locked() has been returning false for the
uni-processor, non-CONFIG_DEBUG_SPINLOCK. The UP + CONFIG_DEBUG_SPINLOCK
handles this correctly.
Found this by enabling CONFIG_DEBUG_VM on PPC and hitting always hitting
a BUG_ON that was testing to make sure the pte_lock was held.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
Linus, a fix for 2.6.31
include/linux/spinlock_up.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/linux/spinlock_up.h b/include/linux/spinlock_up.h
index d4841ed..2b372e0 100644
--- a/include/linux/spinlock_up.h
+++ b/include/linux/spinlock_up.h
@@ -57,7 +57,7 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock)
#define __raw_write_unlock(lock) do { (void)(lock); } while (0)
#else /* DEBUG_SPINLOCK */
-#define __raw_spin_is_locked(lock) ((void)(lock), 0)
+#define __raw_spin_is_locked(lock) ((void)(lock), 1)
/* for sched.c and kernel_lock.c: */
# define __raw_spin_lock(lock) do { (void)(lock); } while (0)
# define __raw_spin_lock_flags(lock, flags) do { (void)(lock); } while (0)
--
1.6.0.6
next reply other threads:[~2009-08-18 22:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-18 22:42 Kumar Gala [this message]
2009-08-18 23:20 ` [PATCH] spinlock: __raw_spin_is_locked() should return true for UP Linus Torvalds
2009-08-18 23:36 ` Steven Rostedt
2009-08-18 23:52 ` Linus Torvalds
2009-08-19 0:07 ` Steven Rostedt
2009-08-19 1:17 ` Kumar Gala
2009-08-19 2:40 ` Linus Torvalds
2009-08-19 9:31 ` Olivier Galibert
2009-08-19 9:38 ` Peter Zijlstra
2009-08-19 18:50 ` Scott Wood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1250635343-32546-1-git-send-email-galak@kernel.crashing.org \
--to=galak@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mingo@elte.hu \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).