Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 245403
b: refs/heads/master
c: 48702ec
h: refs/heads/master
i:
  245401: 01b3198
  245399: 923960d
v: v3
  • Loading branch information
Steven Rostedt authored and Ingo Molnar committed Apr 22, 2011
1 parent 9b86fc0 commit 987af99
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f4185812aa046ecb97e8817e10148cacdd7a6baa
refs/heads/master: 48702ecf308e53f176c1f6fdc193d622ded54ac0
21 changes: 21 additions & 0 deletions trunk/kernel/lockdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -1664,6 +1664,26 @@ static inline void inc_chains(void)

#endif

static void
print_deadlock_scenario(struct held_lock *nxt,
struct held_lock *prv)
{
struct lock_class *next = hlock_class(nxt);
struct lock_class *prev = hlock_class(prv);

printk(" Possible unsafe locking scenario:\n\n");
printk(" CPU0\n");
printk(" ----\n");
printk(" lock(");
__print_lock_name(prev);
printk(");\n");
printk(" lock(");
__print_lock_name(next);
printk(");\n");
printk("\n *** DEADLOCK ***\n\n");
printk(" May be due to missing lock nesting notation\n\n");
}

static int
print_deadlock_bug(struct task_struct *curr, struct held_lock *prev,
struct held_lock *next)
Expand All @@ -1682,6 +1702,7 @@ print_deadlock_bug(struct task_struct *curr, struct held_lock *prev,
print_lock(prev);

printk("\nother info that might help us debug this:\n");
print_deadlock_scenario(next, prev);
lockdep_print_held_locks(curr);

printk("\nstack backtrace:\n");
Expand Down

0 comments on commit 987af99

Please sign in to comment.