From: Yunseong Kim <ysk@kzalloc.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Liang Kan <kan.liang@linux.intel.com>,
James Clark <james.clark@linaro.org>,
Collin Funk <collin.funk1@gmail.com>,
Ravi Bangoria <ravi.bangoria@amd.com>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf test: Add test case for event group throttling with inactive events
Date: Fri, 15 Aug 2025 05:23:44 +0900 [thread overview]
Message-ID: <a40f008e-d552-4ce2-8279-5a25183b7726@kzalloc.com> (raw)
In-Reply-To: <aJ5Bt1q3AZFxxz_U@google.com>
Hi Namhyung,
Thanks for your reply.
On 8/15/25 5:06 AM, Namhyung Kim wrote:
> Hi Yunseong,
>
> On Wed, Aug 13, 2025 at 04:32:52PM +0000, Yunseong Kim wrote:
>> A recent UBSAN shift-out-of-bounds report was identified when throttling
>> event groups that included inactive (PERF_EVENT_STATE_OFF) events.
>> This occurred because pmu->start()/stop() could be called on these events,
>> potentially leaving event->hw.idx at -1. This leads to undefined behavior
>> when PMU code later uses this negative index as a shift exponent.
>>
>> The issue need to ensuring perf_event_throttle() and
>> perf_event_unthrottle() skip inactive events entirely.
>>
>> Introduce a new perf test suite, "event group throttle", to verify this
>> fix and prevent regressions.
>
> Thanks for your work!
>
> I'm curious what happens if it runs on unfixed kernels. I suspect this
> should be in the selftest so that it can tie with the kernel fix.
I agree with your point. I believe it's more appropriate for this test to
be included in "kself test" alongside the kernel fix. I'll modify the
test case based on Liang's suggestion.
> By having this in the perf tools test suite, you cannot guarantee if the
> kernel has the fix. And it may turn the kernel into an unstable state
> easily.
Would it be possible to add this test if it were changed to focus on
a different aspect?
> Thanks,
> Namhyung
Thank you,
Yunseong Kim
next prev parent reply other threads:[~2025-08-14 20:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 16:32 Yunseong Kim
2025-08-14 17:10 ` Liang, Kan
2025-08-14 20:17 ` Yunseong Kim
2025-08-14 20:06 ` Namhyung Kim
2025-08-14 20:23 ` Yunseong Kim [this message]
2025-08-15 20:07 ` Namhyung Kim
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=a40f008e-d552-4ce2-8279-5a25183b7726@kzalloc.com \
--to=ysk@kzalloc.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=collin.funk1@gmail.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@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@amd.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®