]> www.infradead.org Git - users/hch/misc.git/commit
debugobjects,locking: Annotate debug_object_fill_pool() wait type violation
authorPeter Zijlstra <peterz@infradead.org>
Tue, 25 Apr 2023 15:03:13 +0000 (17:03 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 2 May 2023 12:48:14 +0000 (14:48 +0200)
commit0cce06ba859a515bd06224085d3addb870608b6d
tree46e8a34c4176ce2ddaf65cf74c4acecb7fb1ac75
parent0af462f19e635ad522f28981238334620881badc
debugobjects,locking: Annotate debug_object_fill_pool() wait type violation

There is an explicit wait-type violation in debug_object_fill_pool()
for PREEMPT_RT=n kernels which allows them to more easily fill the
object pool and reduce the chance of allocation failures.

Lockdep's wait-type checks are designed to check the PREEMPT_RT
locking rules even for PREEMPT_RT=n kernels and object to this, so
create a lockdep annotation to allow this to stand.

Specifically, create a 'lock' type that overrides the inner wait-type
while it is held -- allowing one to temporarily raise it, such that
the violation is hidden.

Reported-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Qi Zheng <zhengqi.arch@bytedance.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Qi Zheng <zhengqi.arch@bytedance.com>
Link: https://lkml.kernel.org/r/20230429100614.GA1489784@hirez.programming.kicks-ass.net
include/linux/lockdep.h
include/linux/lockdep_types.h
kernel/locking/lockdep.c
lib/debugobjects.c