]> Git Repo - linux.git/commit
locking/lockdep: Free lock classes that are no longer in use
authorBart Van Assche <[email protected]>
Thu, 14 Feb 2019 23:00:46 +0000 (15:00 -0800)
committerIngo Molnar <[email protected]>
Thu, 28 Feb 2019 06:55:43 +0000 (07:55 +0100)
commita0b0fd53e1e67639b303b15939b9c653dbe7a8c4
tree2ad0c4039a0bd9ebc15e03cc6f7f3d2325a23900
parent29fc33fb7283970701355dc89badba4ed21c7092
locking/lockdep: Free lock classes that are no longer in use

Instead of leaving lock classes that are no longer in use in the
lock_classes array, reuse entries from that array that are no longer in
use. Maintain a linked list of free lock classes with list head
'free_lock_class'. Only add freed lock classes to the free_lock_classes
list after a grace period to avoid that a lock_classes[] element would
be reused while an RCU reader is accessing it. Since the lockdep
selftests run in a context where sleeping is not allowed and since the
selftests require that lock resetting/zapping works with debug_locks
off, make the behavior of lockdep_free_key_range() and
lockdep_reset_lock() depend on whether or not these are called from
the context of the lockdep selftests.

Thanks to Peter for having shown how to modify get_pending_free()
such that that function does not have to sleep.

Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Waiman Long <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: [email protected]
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
include/linux/lockdep.h
kernel/locking/lockdep.c
This page took 0.061358 seconds and 4 git commands to generate.