Re: [PATCH 4/2] perf_counter: Fix swcounter context invariance

From: Peter Zijlstra
Date: Thu Aug 13 2009 - 04:23:52 EST


On Thu, 2009-08-13 at 10:05 +0200, Frederic Weisbecker wrote:
> On Thu, Aug 13, 2009 at 09:51:55AM +0200, Peter Zijlstra wrote:
> > Not really related to this topic, but it needs posting anyway.
> >
> > ---
> >
> > Subject: perf_counter: Fix swcounter context invariance
> > From: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
> > Date: Fri Aug 07 13:29:13 CEST 2009
> >
> > perf_swcounter_is_counting() uses a lock, which means we cannot use
> > swcounters from NMI or when holding that particular lock, this is
> > unintended.
> >
> > The below removes the lock, this opens up race window, but not worse
> > than the swcounters already experience due to RCU traversal of the
> > context in perf_swcounter_ctx_event().
> >
> > Cc: Paul Mackerras <paulus@xxxxxxxxx>
> > Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
>
>
>
> As a side effect, it's possible this also fixes the hard lockups
> while opening a lockdep tracepoint counter.

It will -- not a side-effect at all, intended consequence :-)
--
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/