Re: [PATCH v3 04/20] lockdep: Add preemption enabled/disabled assertion APIs

Sebastian A. Siewior
2020-07-07T07:34:22Z

On 2020-07-06 22:50:04 [+0200], Peter Zijlstra wrote:
> On Tue, Jun 30, 2020 at 07:44:36AM +0200, Ahmed S. Darwish wrote:
> > diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> > index d74ac0fd6b2d..e5e2e632b749 100644
> > --- a/lib/Kconfig.debug
> > +++ b/lib/Kconfig.debug
> > @@ -1118,6 +1118,7 @@ config PROVE_LOCKING
> > select DEBUG_RWSEMS
> > select DEBUG_WW_MUTEX_SLOWPATH
> > select DEBUG_LOCK_ALLOC
> > + select PREEMPT_COUNT if !ARCH_NO_PREEMPT
> > select TRACE_IRQFLAGS
> > default n
> > help
>
> I suspect this can be done unconditional, the thing that requires arch
> support is CONFIG_PREEMPTION.

|$ git grep -C 2 PREEMPT_COUNT lib/Kconfig.debug
|lib/Kconfig.debug-config DEBUG_ATOMIC_SLEEP
|lib/Kconfig.debug- bool "Sleep inside atomic section checking"
|lib/Kconfig.debug: select PREEMPT_COUNT
|lib/Kconfig.debug- depends on DEBUG_KERNEL
|lib/Kconfig.debug- depends on !ARCH_NO_PREEMPT

There will be a build fault if you force preempt_count.

Sebastian