lkml.org 
[lkml]   [2018]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] perf: update perf_cgroup time for ancestor cgroup(s)
On Mon, Mar 12, 2018 at 09:59:43AM -0700, Song Liu wrote:
> When a perf_event is attached to parent cgroup, it should count events
> for all children cgroups:
>
> parent_group <---- perf_event
> \
> - child_group <---- process(es)
>
> However, in our tests, we found this perf_event cannot report reliable
> results. Here is an example case:
>
> # create cgroups
> mkdir -p /sys/fs/cgroup/p/c
> # start perf for parent group
> perf stat -e instructions -G "p"
>
> # on another console, run test process in child cgroup:
> stressapptest -s 2 -M 1000 & echo $! > /sys/fs/cgroup/p/c/cgroup.procs
>
> # after the test process is done, stop perf in the first console shows
>
> <not counted> instructions p
>
> The instruction should not be "not counted" as the process runs in the
> child cgroup.
>
> We found this is because perf_event->cgrp and cpuctx->cgrp are not
> identical, thus perf_event->cgrp are not updated properly.
>
> This patch fixes this by updating perf_cgroup properly for ancestor
> cgroup(s).
>
> Signed-off-by: Song Liu <songliubraving@fb.com>
> Reported-by: Ephraim Park <ephiepark@fb.com>

Yeah, that looks about right, Thanks!

\
 
 \ /
  Last update: 2018-03-16 15:26    [W:0.042 / U:1.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site