From: Frederic Weisbecker Date: Tue, 7 Jun 2011 23:51:02 +0000 (+0200) Subject: sched: Make sleeping inside spinlock detection working in !CONFIG_PREEMPT X-Git-Tag: next-20110726~147^2~14^2~1 X-Git-Url: https://git.kernelconcepts.de/?a=commitdiff_plain;h=e8f7c70f44f75c827c04239b0ae5f0068b65b76e;p=karo-tx-linux.git sched: Make sleeping inside spinlock detection working in !CONFIG_PREEMPT Select CONFIG_PREEMPT_COUNT when we enable the sleeping inside spinlock detection, so that the preempt offset gets correctly incremented/decremented from preempt_disable()/preempt_enable(). This makes the preempt count eventually working in !CONFIG_PREEMPT when that debug option is set and thus fixes the detection of explicit preemption disabled sections under such config. Code that sleeps in explicitly preempt disabled section can be finally spotted in non-preemptible kernels. Signed-off-by: Frederic Weisbecker Acked-by: Paul E. McKenney Cc: Ingo Molnar Cc: Peter Zijlstra --- diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 28afa4c5333c..a7dd7b547fea 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -650,6 +650,7 @@ config TRACE_IRQFLAGS config DEBUG_SPINLOCK_SLEEP bool "Spinlock debugging: sleep-inside-spinlock checking" + select PREEMPT_COUNT depends on DEBUG_KERNEL help If you say Y here, various routines which may sleep will become very