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

Peter Zijlstra
2022-08-24T07:27:54Z

On Wed, Aug 24, 2022 at 10:37:36AM +0530, Ravi Bangoria wrote:

> > Now, I suppose making that:
> >
> > {-1, NULL, NULL}, {cpu, NULL, NULL}
> >
> > could work, but wouldn't iterating the the tree be more expensive than
> > just finding the sub-trees as we do now?
>
> pmu=NULL can be used while scheduling entire context. We can just traverse
> through all pmu events of both cpu subtrees.

But imagine the case where we have 50 event for a PMU that can only
schedule 8. Then we have to iterate 42 events for naught instead of
directly jumping to the next PMU.