]> git.baikalelectronics.ru Git - kernel.git/commit
perf/core: Fix event cgroup tracking
authorPeter Zijlstra <peterz@infradead.org>
Wed, 18 Mar 2020 19:33:37 +0000 (20:33 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 8 Apr 2020 09:33:44 +0000 (11:33 +0200)
commit7978133016f11f147a6bedf4705e1966f6b8382e
treed4c3d4cdd35ddbbef62ad7854157fa77c576fd21
parent2a0e90f2f6d77308b54a14fe174104ffdeb41ce3
perf/core: Fix event cgroup tracking

Song reports that installing cgroup events is broken since:

  63b2616328e6 ("perf/core: Optimize perf_install_in_event()")

The problem being that cgroup events try to track cpuctx->cgrp even
for disabled events, which is pointless and actively harmful since the
above commit. Rework the code to have explicit enable/disable hooks
for cgroup events, such that we can limit cgroup tracking to active
events.

More specifically, since the above commit disabled events are no
longer added to their context from the 'right' CPU, and we can't
access things like the current cgroup for a remote CPU.

Cc: <stable@vger.kernel.org> # v5.5+
Fixes: 63b2616328e6 ("perf/core: Optimize perf_install_in_event()")
Reported-by: Song Liu <songliubraving@fb.com>
Tested-by: Song Liu <songliubraving@fb.com>
Reviewed-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20200318193337.GB20760@hirez.programming.kicks-ass.net
kernel/events/core.c