lkml.org 
[lkml]   [2010]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 02/10] perf, trace: Use per-tracepoint-per-cpu hlist to track events
From
Date
On Fri, 2010-05-21 at 12:21 +0200, Frederic Weisbecker wrote:
> On Fri, May 21, 2010 at 12:19:09PM +0200, Peter Zijlstra wrote:
> > On Fri, 2010-05-21 at 12:13 +0200, Frederic Weisbecker wrote:
> > > > I assumed that after probe unregister a tracepoint callback doesn't
> > > > happen, which then guarantees we should never get !head.
> >
> > > I'm not sure about this. The tracepoints are called under rcu_read_lock(),
> > > but there is not synchronize_rcu() after we unregister a tracepoint, which
> > > means you can have a pending preempted one somewhere.
> > >
> > > There is a call_rcu that removes the callbacks, but that only protect
> > > the callback themselves.
> >
> > Ah, ok, so we should do probe_unregister + synchronize_sched().
> > That should ensure __DO_TRACE() doesn't call into it anymore.
> >
> > /me goes make a patch
> >
>
>
> Yep. But that also means we need to rcu_dereference_sched() to access
> the per cpu list of events.

Why?

The per-cpu vars are allocated and freed in a fully serialized manner,
there should be no races what so ever.



\
 
 \ /
  Last update: 2010-05-21 12:37    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site