diff options
-rw-r--r-- | kernel/lockdep.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 73cebd7aa719..c4cc5d1acf48 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -1664,6 +1664,26 @@ static inline void inc_chains(void) | |||
1664 | 1664 | ||
1665 | #endif | 1665 | #endif |
1666 | 1666 | ||
1667 | static void | ||
1668 | print_deadlock_scenario(struct held_lock *nxt, | ||
1669 | struct held_lock *prv) | ||
1670 | { | ||
1671 | struct lock_class *next = hlock_class(nxt); | ||
1672 | struct lock_class *prev = hlock_class(prv); | ||
1673 | |||
1674 | printk(" Possible unsafe locking scenario:\n\n"); | ||
1675 | printk(" CPU0\n"); | ||
1676 | printk(" ----\n"); | ||
1677 | printk(" lock("); | ||
1678 | __print_lock_name(prev); | ||
1679 | printk(");\n"); | ||
1680 | printk(" lock("); | ||
1681 | __print_lock_name(next); | ||
1682 | printk(");\n"); | ||
1683 | printk("\n *** DEADLOCK ***\n\n"); | ||
1684 | printk(" May be due to missing lock nesting notation\n\n"); | ||
1685 | } | ||
1686 | |||
1667 | static int | 1687 | static int |
1668 | print_deadlock_bug(struct task_struct *curr, struct held_lock *prev, | 1688 | print_deadlock_bug(struct task_struct *curr, struct held_lock *prev, |
1669 | struct held_lock *next) | 1689 | struct held_lock *next) |
@@ -1682,6 +1702,7 @@ print_deadlock_bug(struct task_struct *curr, struct held_lock *prev, | |||
1682 | print_lock(prev); | 1702 | print_lock(prev); |
1683 | 1703 | ||
1684 | printk("\nother info that might help us debug this:\n"); | 1704 | printk("\nother info that might help us debug this:\n"); |
1705 | print_deadlock_scenario(next, prev); | ||
1685 | lockdep_print_held_locks(curr); | 1706 | lockdep_print_held_locks(curr); |
1686 | 1707 | ||
1687 | printk("\nstack backtrace:\n"); | 1708 | printk("\nstack backtrace:\n"); |