From: Peter Zijlstra <peterz@infradead.org>
To: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
James Clark <james.clark@linaro.org>,
Andi Kleen <ak@linux.intel.com>,
Dapeng Mi <dapeng1.mi@linux.intel.com>,
Kan Liang <kan.liang@linux.intel.com>,
Thomas Falcon <thomas.falcon@intel.com>,
Stephane Eranian <eranian@google.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] perf/core: Add PERF_EVENT_STATE_ON to fix filtered event enabled time
Date: Tue, 1 Dec 2026 10:18:58 +0100 [thread overview]
Message-ID: <20261201091858.GE2883950@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <CAP-5=fVySYQe860+JMpTGm2RE=MPZQB_eKAoJrC-75mb+KY+GQ@mail.gmail.com>
On Mon, Nov 30, 2026 at 10:42:55AM -0800, Ian Rogers wrote:
> On Wed, Nov 25, 2026 at 5:02 AM Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Wed, Nov 25, 2026 at 01:37:12PM +0100, Peter Zijlstra wrote:
> > > On Tue, Nov 24, 2026 at 10:52:28PM -0800, Ian Rogers wrote:
> > > > @@ -4134,6 +4154,21 @@ struct merge_sched_data {
> > > > enum event_type_t event_type;
> > > > };
> > > >
> > > > +static void group_set_inactive(struct perf_event *group_event)
> > > > +{
> > > > + struct perf_event *sibling;
> > > > +
> > > > + perf_event_set_state(group_event, PERF_EVENT_STATE_INACTIVE);
> > > > +
> > > > + for_each_sibling_event(sibling, group_event) {
> > > > + if (sibling->state == PERF_EVENT_STATE_ON)
> > > > + perf_event_set_state(sibling, PERF_EVENT_STATE_INACTIVE);
> > > > + }
> > > > +
> > > > + list_add_tail(&group_event->active_list,
> > > > + &group_event->pmu_ctx->flexible_inactive);
> > > > +}
> >
> > This whole thing looks dodgy as well. This feels like
> > __perf_effective_state() needs an update or something.
>
>
> Thanks for the review, Peter! I've sent v4 addressing all of these:
> https://lore.kernel.org/linux-perf-users/8b61be11e09ae7f663253cde769eff5456ebc263.1796063587.git.irogers@google.com/
>
> - Took your state diagram and comment cleanup in perf_event.h.
> - Updated __perf_effective_state() and perf_event_set_state() so enabled
> (ON) siblings inherit INACTIVE from their group leader, removing
> group_set_inactive() (while promoting ON siblings to INACTIVE on
> flexible_inactive if an INACTIVE leader is detached).
> - De-duplicated the pending_disable path in event_sched_out().
> - Updated merge_sched_in() to branch directly on group_can_go_on() and
> group_sched_in() rather than testing event->state == ON. In
> event_sched_in(), reverting the speculative ACTIVE back to ON keeps
> siblings in ON and matches group_error: rollback so merge_sched_in()
> remains the single place transitioning ON -> {ERROR, INACTIVE}.
>
I've got to ask; are you vibing this? There seem to be random changes in
the patch not listed above that make review harder than it wants to be.
Eg. there is now a shortcut in group_sched_out() that avoids iterating
the siblings when !active. This then leads to other weirdness.
prev parent reply other threads:[~2026-12-01 9:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 6:52 Ian Rogers
2026-11-25 6:52 ` [PATCH v3 2/2] perf test: Add filtered event enabled time tests to event-times Ian Rogers
2026-11-25 12:37 ` [PATCH v3 1/2] perf/core: Add PERF_EVENT_STATE_ON to fix filtered event enabled time Peter Zijlstra
2026-11-25 13:02 ` Peter Zijlstra
2026-11-30 18:42 ` Ian Rogers
2026-12-01 9:18 ` Peter Zijlstra [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261201091858.GE2883950@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dapeng1.mi@linux.intel.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=thomas.falcon@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®