lockdep: Print a nicer description for normal deadlocks
commitf4185812aa046ecb97e8817e10148cacdd7a6baa
authorSteven Rostedt <srostedt@redhat.com>
Thu, 21 Apr 2011 01:41:55 +0000 (20 21:41 -0400)
committerIngo Molnar <mingo@elte.hu>
Fri, 22 Apr 2011 09:06:57 +0000 (22 11:06 +0200)
treea17a417d13586554f452df9fd251165c4d714a97
parent3003eba313dd0e0502dd71548c36fe7c19801ce5
lockdep: Print a nicer description for normal deadlocks

The lockdep output can be pretty cryptic, having nicer output
can save a lot of head scratching. When a normal deadlock
scenario is detected by lockdep (lock A -> lock B and there
exists a place where lock B -> lock A) we now get the following
new output:

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(lockB);
                               lock(lockA);
                               lock(lockB);
  lock(lockA);

 *** DEADLOCK ***

On cases where there's a deeper chair, it shows the partial
chain that can cause the issue:

Chain exists of:
  lockC --> lockA --> lockB

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(lockB);
                               lock(lockA);
                               lock(lockB);
  lock(lockC);

 *** DEADLOCK ***

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/20110421014259.380621789@goodmis.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/lockdep.c