Skip to content

Commit ff9bf4b

Browse files
author
Kent Overstreet
committed
lockdep: Fix lockdep_set_notrack_class() for CONFIG_LOCK_STAT
We won't find a contended lock if it's not being tracked. Signed-off-by: Kent Overstreet <[email protected]>
1 parent e61dd67 commit ff9bf4b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

kernel/locking/lockdep.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5936,6 +5936,9 @@ __lock_contended(struct lockdep_map *lock, unsigned long ip)
59365936
if (DEBUG_LOCKS_WARN_ON(!depth))
59375937
return;
59385938

5939+
if (unlikely(lock->key == &__lockdep_no_track__))
5940+
return;
5941+
59395942
hlock = find_held_lock(curr, lock, depth, &i);
59405943
if (!hlock) {
59415944
print_lock_contention_bug(curr, lock, ip);
@@ -5978,6 +5981,9 @@ __lock_acquired(struct lockdep_map *lock, unsigned long ip)
59785981
if (DEBUG_LOCKS_WARN_ON(!depth))
59795982
return;
59805983

5984+
if (unlikely(lock->key == &__lockdep_no_track__))
5985+
return;
5986+
59815987
hlock = find_held_lock(curr, lock, depth, &i);
59825988
if (!hlock) {
59835989
print_lock_contention_bug(curr, lock, _RET_IP_);

0 commit comments

Comments
 (0)