diff options
author | Yuyang Du <duyuyang@gmail.com> | 2019-05-06 04:19:21 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-06-03 05:55:36 -0400 |
commit | 834494b28024b39d45aea6bcc642b0fe94fe2503 (patch) | |
tree | d32d9d13bcd1406c88995341d1b4305179d84787 /kernel/locking | |
parent | e7a38f63ba50dc95426dd50c43383dfecaa35d7f (diff) |
locking/lockdep: Print the right depth for chain key collision
Since chains are separated by IRQ context, so when printing a chain the
depth should be consistent with it.
Signed-off-by: Yuyang Du <duyuyang@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: bvanassche@acm.org
Cc: frederic@kernel.org
Cc: ming.lei@redhat.com
Cc: will.deacon@arm.com
Link: https://lkml.kernel.org/r/20190506081939.74287-6-duyuyang@gmail.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/locking')
-rw-r--r-- | kernel/locking/lockdep.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 3c477018e184..bc1efc12a8c5 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c | |||
@@ -2519,10 +2519,11 @@ print_chain_keys_held_locks(struct task_struct *curr, struct held_lock *hlock_ne | |||
2519 | struct held_lock *hlock; | 2519 | struct held_lock *hlock; |
2520 | u64 chain_key = 0; | 2520 | u64 chain_key = 0; |
2521 | int depth = curr->lockdep_depth; | 2521 | int depth = curr->lockdep_depth; |
2522 | int i; | 2522 | int i = get_first_held_lock(curr, hlock_next); |
2523 | 2523 | ||
2524 | printk("depth: %u\n", depth + 1); | 2524 | printk("depth: %u (irq_context %u)\n", depth - i + 1, |
2525 | for (i = get_first_held_lock(curr, hlock_next); i < depth; i++) { | 2525 | hlock_next->irq_context); |
2526 | for (; i < depth; i++) { | ||
2526 | hlock = curr->held_locks + i; | 2527 | hlock = curr->held_locks + i; |
2527 | chain_key = print_chain_key_iteration(hlock->class_idx, chain_key); | 2528 | chain_key = print_chain_key_iteration(hlock->class_idx, chain_key); |
2528 | 2529 | ||