Re: [RFC][PATCH 05/11] perf: register pmu implementations

From: Frederic Weisbecker
Date: Mon Jun 28 2010 - 11:29:22 EST

On Mon, Jun 28, 2010 at 05:16:37PM +0200, Peter Zijlstra wrote:
> > > }
> > > + srcu_read_unlock(&pmus_srcu, idx);
> > >
> > > return pmu;
> > > }
> >
> >
> >
> > I'm still not sure why all this locking is needed. We don't even
> > support pmus in modules.
> >
> > Is there something coming soon that will use this?
> > I remember something about KVM.
> Possibly, not sure. We could put the unregister thing in a later patch,
> but I wanted to make sure it was sanely possibly and its only a few
> lines of code.


> > And who will have to use srcu? It seems the event fastpath would
> > be concerned, right? Will that have an impact on the performances?
> Only event creation like above (perf_init_event) will have to use SRCU,
> so not really a hot path.

Ah I see. The event itself is synchronized against the fast-path using rcu.
And then pmus themselves would be synchronized against events. Right
that makes sense.

But then why RCU (or SRCU, whatever)? I mean parent event creation is
quite rare. And child events won't need to be synchronized as far as the parent
keeps a reference to the pmu.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at