lkml.org 
[lkml]   [2021]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/2] perf/core: Share an event with multiple cgroups
Date


> On Mar 29, 2021, at 4:33 AM, Namhyung Kim <namhyung@kernel.org> wrote:
>
> On Mon, Mar 29, 2021 at 2:17 AM Song Liu <songliubraving@fb.com> wrote:
>>> On Mar 23, 2021, at 9:21 AM, Namhyung Kim <namhyung@kernel.org> wrote:
>>>
>>> As we can run many jobs (in container) on a big machine, we want to
>>> measure each job's performance during the run. To do that, the
>>> perf_event can be associated to a cgroup to measure it only.
>>>

[...]

>>> + return 0;
>>> +}
>>
>> Could you please explain why we need this logic in can_attach?
>
> IIUC the ss->attach() is called after a task's cgroup membership
> is changed. But we want to collect the performance numbers for
> the old cgroup just before the change. As the logic merely checks
> the current task's cgroup, it should be done in the can_attach()
> which is called before the cgroup change.

Thanks for the explanations.

Overall, I really like the core idea, especially that the overhead on
context switch is bounded (by the depth of cgroup tree).

Is it possible to make PERF_EVENT_IOC_ATTACH_CGROUP more flexible?
Specifically, if we can have

PERF_EVENT_IOC_ADD_CGROUP add a cgroup to the list
PERF_EVENT_IOC_EL_CGROUP delete a cgroup from the list

we can probably share these events among multiple processes, and
these processes don't need to know others' cgroup list. I think
this will be useful for users to build customized monitoring in
its own container.

Does this make sense?

Thanks,
Song

\
 
 \ /
  Last update: 2021-03-30 08:35    [W:0.089 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site