RE: [RFC 3/6] perf/core: use rb-tree to sched in event groups

From: Liang, Kan
Date: Thu Jan 12 2017 - 08:28:57 EST




> On Wed, Jan 11, 2017 at 08:31:11PM +0000, Liang, Kan wrote:
>
> > > Kan, in your per-cpu event list patch you mentioned that you saw a
> > > large overhead in perf_iterate_ctx() when skipping events for other
> CPUs.
> > > Which callers of perf_iterate_ctx() specifically was that
> > > problematic for? Do those callers only care about the *active* events,
> for example?
> >
> > Based on my test, the large overhead was observed in perf_iterate_sb.
> > Yes, it only cares about the *active* events.
>

Oh Sorry, my bad. My brain must not be working yesterday...
I just re-visited the code. The *inactive* also need to be checked.
if (event->state < PERF_EVENT_STATE_INACTIVE)
continue;
So the perf_iterate_sb iterates through all events (both STATE_ACTIVE
and STATE_INACTIVE).

I'm not sure if it is enough to only take care of *active* events.
Peter may comments on it.

Thanks,
Kan

> Great!
>
> That should mean the first patch of this series (adding the active events
> lists) should give us sufficient infrastructure to solve that particular issue.
>
> Thanks,
> Mark.