mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
locking/lockdep: Make it easy to detect whether or not inside a selftest
The patch that frees unused lock classes will modify the behavior of lockdep_free_key_range() and lockdep_reset_lock() depending on whether or not these functions are called from the context of the lockdep selftests. Hence make it easy to detect whether or not lockdep code is called from the context of a lockdep selftest. 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]>
This commit is contained in:
parent
956f3563a8
commit
cdc84d7949
3 changed files with 13 additions and 0 deletions
|
|
@ -1989,6 +1989,7 @@ void locking_selftest(void)
|
|||
|
||||
init_shared_classes();
|
||||
debug_locks_silent = !debug_locks_verbose;
|
||||
lockdep_set_selftest_task(current);
|
||||
|
||||
DO_TESTCASE_6R("A-A deadlock", AA);
|
||||
DO_TESTCASE_6R("A-B-B-A deadlock", ABBA);
|
||||
|
|
@ -2097,5 +2098,6 @@ void locking_selftest(void)
|
|||
printk("---------------------------------\n");
|
||||
debug_locks = 1;
|
||||
}
|
||||
lockdep_set_selftest_task(NULL);
|
||||
debug_locks_silent = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue