Re: [RFC][PATCH] perf: Rewrite core context handling

From: Peter Zijlstra
Date: Wed Oct 17 2018 - 07:07:18 EST


On Tue, Oct 16, 2018 at 06:28:10PM +0000, Song Liu wrote:
> > How about this:
> >
> > 1. Keep multiple perf_cpu_context per CPU, just like before this patch.
> >
> > 2. For perf_event_context, add PMU as an order for the RB tree.
> >
> > 3. (hw) pmu->perf_cpu_context->ctx only has events for this PMU (and sw
> > events moved to this context).
> >
> > 4. task->perf_event_ctxp has events for all PMUs.
> >
> > With this path, we keep the existing perf_cpu_context/perf_event_context
> > logic as-is, which I think is simpler than the new logic (with extra
> > *_pmu_context). And it should also solve the problem.
> >
> > Does this make sense? If this doesn't look too broken, I am happy to
> > draft RFC for it.
> >
>
> I am not sure whether you missed this one, or found it totally insane.
> Could you please share your comments on it? My gut feeling is that this
> would be a simpler patch to solve the problem (two hw PMUs). (It might
> be less efficient though).

Ah, sorry, somehow this email got lost.

That makes task and cpu contexts wildly different, which will complicate
matters I feel.