Skip to contentSkip to conversation

lib/Kconfig: make PREEMPT_COUNT depend on PREEMPT in DEBUG_ATOMIC_SLEEP

PATCH In review Yang Shi 2 participants 2 messages Feb 12, 2016 – Feb 13, 2016 Library code

lore
Share & tools
lore

Yang Shi

author
#0 lore raw

PATCH 1/1 lib/Kconfig: make PREEMPT_COUNT depend on PREEMPT in DEBUG_ATOMIC_SLEEP

When building non-preempt kernel (PREEMPT_NONE), PREEMPT_COUNT is still enabled if DEBUG_ATOMIC_SLEEP is enabled. But, it sounds not make sense to have PREEMPT_COUNT set in non-preempt kernel.

So, make PREEMPT_COUNT depend on PREEMPT here.

---
 lib/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -1
index ecb9e75..a5b6e11 100644
@@ -1075,7 +1075,7 @@ config DEBUG_LOCKDEP
 
 config DEBUG_ATOMIC_SLEEP
 	bool "Sleep inside atomic section checking"
-	select PREEMPT_COUNT
+	select PREEMPT_COUNT if PREEMPT
 	depends on DEBUG_KERNEL
 	help
 	  If you say Y here, various routines which may sleep will become very
Signature · 1 line
2.0.2
#1 lore raw
Quoted 16 lines · Yang Shi

When building non-preempt kernel (PREEMPT_NONE), PREEMPT_COUNT is still enabled if DEBUG_ATOMIC_SLEEP is enabled. But, it sounds not make sense to have PREEMPT_COUNT set in non-preempt kernel.

So, make PREEMPT_COUNT depend on PREEMPT here.

---
 lib/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +0 -0
index ecb9e75..a5b6e11 100644

lib/Kconfig.debug config DEBUG_LOCKDEP · line 1078

Quoted 5 lines
lib/Kconfig.debug +1 -1
@@ -1075,7 +1075,7 @@ config DEBUG_LOCKDEP
 
 config DEBUG_ATOMIC_SLEEP
 	bool "Sleep inside atomic section checking"
-	select PREEMPT_COUNT
+	select PREEMPT_COUNT if PREEMPT

OK, so do tell, how is it supposed to debug atomic sections without actually tracking atomic sections?