From 987af9903337f085046abe32bebccc47c9f0ba21 Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Wed, 20 Apr 2011 21:41:56 -0400 Subject: [PATCH] --- yaml --- r: 245403 b: refs/heads/master c: 48702ecf308e53f176c1f6fdc193d622ded54ac0 h: refs/heads/master i: 245401: 01b31980886b4d440683d4c30942962521ab692b 245399: 923960db21001001709a64bb9c86d80c9f18f0f7 v: v3 --- [refs] | 2 +- trunk/kernel/lockdep.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 391c62f0a112..80c06c1857e6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f4185812aa046ecb97e8817e10148cacdd7a6baa +refs/heads/master: 48702ecf308e53f176c1f6fdc193d622ded54ac0 diff --git a/trunk/kernel/lockdep.c b/trunk/kernel/lockdep.c index 73cebd7aa719..c4cc5d1acf48 100644 --- a/trunk/kernel/lockdep.c +++ b/trunk/kernel/lockdep.c @@ -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) @@ -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");