preempt: Allow CONFIG_DEBUG_PREEMPT for CONFIG_PREEMPT_VOLUNTARY
Subsystems (2)
PATCH 1/1 preempt: Allow CONFIG_DEBUG_PREEMPT for CONFIG_PREEMPT_VOLUNTARY
While recently staring at some preempt_count dumpster fire for a CONFIG_PREEMPT_VOLUNTARY kernel, I wished I could turn on CONFIG_DEBUG_PREEMPT on top of CONFIG_DEBUG_ATOMIC_SLEEP to see *where* preemption had been disabled. It didn't take much to get that, and although it didn't help my particular case, I think it can still be useful.
--- kernel/sched/core.c | 3 +-- lib/Kconfig.debug | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
kernel/sched/core.c +1 -2
@@ -5109,8 +5109,7 @@ static inline void sched_tick_start(int cpu) { }static inline void sched_tick_stop (int cpu) { }#endif -#if defined(CONFIG_PREEMPTION ) && (defined(CONFIG_DEBUG_PREEMPT ) || \ - defined(CONFIG_TRACE_PREEMPT_TOGGLE )) +#if defined(CONFIG_DEBUG_PREEMPT ) || defined(CONFIG_TRACE_PREEMPT_TOGGLE )/* * If the value passed in is equal to the current preempt count * then we just disabled preemption. Start timing the latency.
lib/Kconfig.debug +1 -1
@@ -1204,7 +1204,7 @@ config DEBUG_TIMEKEEPING config DEBUG_PREEMPT bool "Debug preemptible kernel" - depends on DEBUG_KERNEL && PREEMPTION && TRACE_IRQFLAGS_SUPPORT + depends on DEBUG_KERNEL && PREEMPT_COUNT && TRACE_IRQFLAGS_SUPPORT default y help If you say Y here then the kernel will use a debug variant of the
Signature · 1 line
2.25.1
Quoted 31 lines · Valentin Schneider
While recently staring at some
preempt_countdumpster fire for aCONFIG_PREEMPT_VOLUNTARYkernel, I wished I could turn onCONFIG_DEBUG_PREEMPTon top ofCONFIG_DEBUG_ATOMIC_SLEEPto see *where* preemption had been disabled. It didn't take much to get that, and although it didn't help my particular case, I think it can still be useful.Signed-off-by Valentin Schneider <[email protected]>--- kernel/sched/core.c | 3 +-- lib/Kconfig.debug | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)kernel/sched/core.c +1
-2@@ -5109,8 +5109,7 @@ static inline void sched_tick_start(int cpu) { }static inline void sched_tick_stop (int cpu) { }#endif -#if defined(CONFIG_PREEMPTION ) && (defined(CONFIG_DEBUG_PREEMPT ) || \ - defined(CONFIG_TRACE_PREEMPT_TOGGLE )) +#if defined(CONFIG_DEBUG_PREEMPT ) || defined(CONFIG_TRACE_PREEMPT_TOGGLE )/* * If the value passed in is equal to the current preempt count * then we just disabled preemption. Start timing the latency. lib/Kconfig.debug +0
-0
lib/Kconfig.debug config DEBUG_TIMEKEEPING · line 1207
Quoted 5 lines
lib/Kconfig.debug +1
-1@@ -1204,7 +1204,7 @@ config DEBUG_TIMEKEEPING config DEBUG_PREEMPT bool "Debug preemptible kernel" - depends on DEBUG_KERNEL && PREEMPTION && TRACE_IRQFLAGS_SUPPORT + depends on DEBUG_KERNEL && PREEMPT_COUNT && TRACE_IRQFLAGS_SUPPORT
IIRC it used to be that way before. That was the reason for the split of CONFIG_PREEMPT_COUNT from CONFIG_PREEMPT in the first place. Not sure what happened. But anyway, your patch looks welcome.
Thanks.
Quoted 6 lines
lib/Kconfig.debug +0
-0default y help If you say Y here then the kernel will use a debug variant of theSignature · 1 line
2.25.1