aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/bit_spinlock.h
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2011-06-08 01:13:27 +0200
committerFrederic Weisbecker <fweisbec@gmail.com>2011-06-10 15:15:40 +0200
commitbdd4e85dc36cdbcfc1608a5b2a17c80a9db8986a (patch)
tree9cee98e78a5aa6a00f3b7ce805b1e39a0137b4a4 /include/linux/bit_spinlock.h
parentsched: Remove pointless in_atomic() definition check (diff)
downloadlinux-dev-bdd4e85dc36cdbcfc1608a5b2a17c80a9db8986a.tar.xz
linux-dev-bdd4e85dc36cdbcfc1608a5b2a17c80a9db8986a.zip
sched: Isolate preempt counting in its own config option
Create a new CONFIG_PREEMPT_COUNT that handles the inc/dec of preempt count offset independently. So that the offset can be updated by preempt_disable() and preempt_enable() even without the need for CONFIG_PREEMPT beeing set. This prepares to make CONFIG_DEBUG_SPINLOCK_SLEEP working with !CONFIG_PREEMPT where it currently doesn't detect code that sleeps inside explicit preemption disabled sections. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Diffstat (limited to 'include/linux/bit_spinlock.h')
-rw-r--r--include/linux/bit_spinlock.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/bit_spinlock.h b/include/linux/bit_spinlock.h
index b4326bfa684f..564d997e2168 100644
--- a/include/linux/bit_spinlock.h
+++ b/include/linux/bit_spinlock.h
@@ -88,7 +88,7 @@ static inline int bit_spin_is_locked(int bitnum, unsigned long *addr)
{
#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
return test_bit(bitnum, addr);
-#elif defined CONFIG_PREEMPT
+#elif defined CONFIG_PREEMPT_COUNT
return preempt_count();
#else
return 1;