Re: [RFC 1/2] perf core: Add PERF_COUNT_SW_CGROUP_SWITCHES event

Namhyung Kim
2020-12-04T07:28:42Z

On Thu, Dec 3, 2020 at 9:20 PM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Wed, Dec 02, 2020 at 11:28:28AM -0800, Andi Kleen wrote:
> > > + prev_cgrp = task_css_check(prev, perf_event_cgrp_id, 1)->cgroup;
> > > + next_cgrp = task_css_check(next, perf_event_cgrp_id, 1)->cgroup;
> > > +
> > > + if (prev_cgrp != next_cgrp)
> > > + perf_sw_event_sched(PERF_COUNT_SW_CGROUP_SWITCHES, 1, 0);
> >
> > Seems to be the perf cgroup only, not all cgroups.
> > That's a big difference and needs to be documented properly.
>
> With cgroup-v2 that's all the same, no?

Right, but unfortunately it seems still cgroup v1 is used widely.

Thanks,
Namhyung