diff options
author | Ahmed S. Darwish <a.darwish@linutronix.de> | 2020-07-20 17:55:13 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2020-07-29 16:14:24 +0200 |
commit | 8fd8ad5c5dfcb09cf62abadd4043eaf1afbbd0ce (patch) | |
tree | d1959b43c4110967be60aa02352330d5a748fbda /lib | |
parent | 932e46365226324d2cf26d8bdec8b51ceb296948 (diff) |
lockdep: Add preemption enabled/disabled assertion APIs
Asserting that preemption is enabled or disabled is a critical sanity
check. Developers are usually reluctant to add such a check in a
fastpath as reading the preemption count can be costly.
Extend the lockdep API with macros asserting that preemption is disabled
or enabled. If lockdep is disabled, or if the underlying architecture
does not support kernel preemption, this assert has no runtime overhead.
References: f54bb2ec02c8 ("locking/lockdep: Add IRQs disabled/enabled assertion APIs: ...")
Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200720155530.1173732-8-a.darwish@linutronix.de
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kconfig.debug | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 9ad9210d70a1..5379931ba3b5 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -1117,6 +1117,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 |