[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1303386029.7181.118.camel@gandalf.stny.rr.com>
Date: Thu, 21 Apr 2011 07:40:29 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Yong Zhang <yong.zhang0@...il.com>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
"H. Peter Anvin" <hpa@...or.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>
Subject: Re: [PATCH 1/7] lockdep: Print a nice description of an irq
locking issue
On Thu, 2011-04-21 at 15:02 +0800, Yong Zhang wrote:
> On Thu, Apr 21, 2011 at 9:41 AM, Steven Rostedt <rostedt@...dmis.org> wrote:
> > ---
> >
> > The above is the case when the unsafe lock is taken while holding
> > a lock taken in irq context. But when a lock is taken that also
> > grabs a unsafe lock, the call chain is shown:
> >
> > ---
> > other info that might help us debug this:
> >
> > Chain exists of:
> > &rq->lock --> lockA --> lockC
> >
> > Possible interrupt unsafe locking scenario:
> >
> > CPU0 CPU1
> > ---- ----
> > lock(lockC);
> > local_irq_disable();
> > lock(&rq->lock);
> > lock(lockA);
> > <Interrupt>
> > lock(&rq->lock);
> >
> > *** DEADLOCK ***
>
> Or we could show this:
> Chain exists of:
> &rq->lock --> lockA --> lockC
>
> Possible interrupt unsafe locking scenario:
>
> CPU0 CPU1 CPU2
> ---- ---- ----
> lock(lockC);
> local_irq_disable();
> lock(&rq->lock); lock(lockA);
> lock(lockA); lock(lockC);
> <Interrupt>
> lock(&rq->lock);
>
> *** DEADLOCK ***
We could but I prefer not to ;) We have some chains that are 8 locks
deep. I really don't want to scatter that entirely across the screen.
Hence my "Chain exists.." statement, following an example that any
kernel developer can (with a little thinking) see is a possible
deadlock.
In fact, this code doesn't even look at the full chain, it only examines
3 locks in the chain, and lets the developer figure out the rest. I
could show the entire chain too.
Thanks,
-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists