[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250604155949.GK39944@noisy.programming.kicks-ass.net>
Date: Wed, 4 Jun 2025 17:59:49 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Leo Yan <leo.yan@....com>
Cc: Yeoreum Yun <yeoreum.yun@....com>, mingo@...hat.com, mingo@...nel.org,
acme@...nel.org, namhyung@...nel.org, mark.rutland@....com,
alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
irogers@...gle.com, adrian.hunter@...el.com,
kan.liang@...ux.intel.com, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org, David Wang <00107082@....com>
Subject: Re: [PATCH 1/1] perf/core: fix dangling cgroup pointer in cpuctx
On Wed, Jun 04, 2025 at 04:46:39PM +0100, Leo Yan wrote:
> On Wed, Jun 04, 2025 at 04:16:40PM +0200, Peter Zijlstra wrote:
>
> [...]
>
> > It might be prudent to do something like so:
>
> Thanks for the patch.
>
> > +static void __event_disable(struct perf_event *event,
> > + struct perf_event_context *ctx,
> > + enum perf_event_state state)
> > +{
> > + if (event == event->group_leader)
> > + group_sched_out(event, ctx);
>
> I am a bit struggle for this code line. It disables all events in a
> group, but only clear cgroup pointer for group leader but miss to clear
> for sibling events.
>
> If the cgroup pointer is only used for group leader, maybe we only
> maintain (set and clear) the cgroup pointer for the leader?
Hmm, so yeah, that is weird indeed.
So perf_cgroup_event_enable() is called in list_add_event(), which is
perf_install_in_context() and that should be every single event.
So yeah, I'm thinking we're having more bugs here still :-(
Powered by blists - more mailing lists