Re: [PATCH v2 1/2] perf/core: Fix nr_cgroups/cpuctx->cgrp is not updated correctly

From: Peter Zijlstra
Date: Wed Jun 04 2025 - 05:19:55 EST


On Wed, Jun 04, 2025 at 03:39:23AM +0000, Luo Gengkun wrote:
> Since __perf_remove_from_context updates event->state before
> list_del_event, this prevents list_del_event from calling
> perf_cgroup_event_disable, resulting in will not update nr_cgroups and
> cpuctx->cgrp.
>
> To fix this problem, move perf_cgroup_event_disable into
> __perf_remove_from_context as:
>
> commit a3c3c66670ce ("perf/core: Fix child_total_time_enabled accounting bug at task exit")
>
> did.
>
> Fixes: a3c3c66670ce ("perf/core: Fix child_total_time_enabled accounting bug at task exit")
> Signed-off-by: Luo Gengkun <luogengkun@xxxxxxxxxxxxxxx>

So I already have Yeoreum's patch for this:

https://lkml.kernel.org/r/20250603144414.GC38114@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx