Re: [BUG] perf: hard lockup when using perf-sched

From: Frederic Weisbecker
Date: Fri Mar 26 2010 - 15:27:23 EST


On Fri, Mar 26, 2010 at 08:10:40PM +0100, Mike Galbraith wrote:
> On Fri, 2010-03-26 at 18:23 +0100, Frederic Weisbecker wrote:
> > On Fri, Mar 26, 2010 at 11:11:33AM +0100, Mike Galbraith wrote:
>
> > > perf: fix perf sched record forkbomb deadlock
> > >
> > > perf sched record can deadlock a box should the holder of handle->data->lock
> > > take an interrupt, and then attempt to acquire an rq lock held by a CPU trying
> > > to acquire the same lock. Disable interrupts.
> >
> >
> >
> > Aah.
> >
> > So the scenario is the following inversion?
> >
> > CPU0 CPU1
> > sched event with rq->lock held
> > grab handle->data->lock
> > spin on handle->data->lock
> > interrupt
> > try to grab rq->lock
>
> Yeah, handle->data->lock holder dare not try to grab any rq lock because
> of sched event with rq->lock held.
>


But if that happens with perf sched, there is something weird.
perf sched only use sched events, which have interrupt disabled
from the trace event handler, so this is not supposed to happen.

But if there is another kind of event involved, something that has
interrupts enabled, may be some software events, then it may
happen indeed.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/