]> git.baikalelectronics.ru Git - kernel.git/commit
lockdep: Add preemption enabled/disabled assertion APIs
authorAhmed S. Darwish <a.darwish@linutronix.de>
Mon, 20 Jul 2020 15:55:13 +0000 (17:55 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 29 Jul 2020 14:14:24 +0000 (16:14 +0200)
commit72d5acec3df4abae3c21c1ce0454ee58329094e5
treed1959b43c4110967be60aa02352330d5a748fbda
parentc5ded6cfcbf0d9c98540746a4d18d22bfe077b01
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: 8a47eeb2a934 ("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
include/linux/lockdep.h
lib/Kconfig.debug