From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v1 10/12] perf tests: Speed up off-cpu profiling tests
Date: Tue, 16 Jun 2026 01:41:03 +0000 [thread overview]
Message-ID: <20260616014104.563901F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260616012744.4049193-11-irogers@google.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Scaling down the off-cpu threshold margin to 20ms in the below-threshold test introduces severe test flakiness due to scheduling latencies.
--
commit 9a01b97619e9e9de7c1d6aeb44a8dcd7c6b1f2b5
Author: Ian Rogers <irogers@google.com>
perf tests: Speed up off-cpu profiling tests
This commit speeds up the off-cpu profiling tests by scaling down workload
durations and thresholds by a factor of 10. The sleep time is reduced from
1 second to 0.1 seconds, decreasing the total test sleep overhead from 3.0
seconds to 0.3 seconds.
> diff --git a/tools/perf/tests/shell/record_offcpu.sh b/tools/perf/tests/shell/record_offcpu.sh
> --- a/tools/perf/tests/shell/record_offcpu.sh
> +++ b/tools/perf/tests/shell/record_offcpu.sh
[ ... ]
> @@ -128,8 +128,8 @@ test_offcpu_above_thresh() {
> test_offcpu_below_thresh() {
> echo "${test_below_thresh}"
>
> - # collect direct off-cpu samples for tasks blocked for more than 1.2s
> - if ! perf record -e dummy --off-cpu --off-cpu-thresh 1200 -o ${perfdata} -- sleep 1 2> /dev/null
> + # collect direct off-cpu samples for tasks blocked for more than 120ms
> + if ! perf record -e dummy --off-cpu --off-cpu-thresh 120 -o ${perfdata} -- sleep 0.1 2> /dev/null
[Severity: Medium]
Will this tight 20ms margin cause test flakiness on busy systems or CI
environments?
In test_offcpu_below_thresh(), the test asserts that no direct off-cpu
samples are generated, requiring the total off-cpu time to remain strictly
below the 120ms threshold. Since sleep 0.1 guarantees a minimum of 100ms
off-cpu time, this leaves only 20ms for system scheduling overhead such as
timer granularity, wake-up latency, and runqueue wait time.
If scheduling latency pushes the total off-cpu time over 120ms, the BPF
program will emit a direct sample, causing the test to falsely fail. The
previous configuration of a 1000ms sleep versus a 1200ms threshold provided
a much more resilient 200ms margin.
> then
> echo "${test_below_thresh} [Failed record]"
> err=1
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260616012744.4049193-1-irogers@google.com?part=10
next prev parent reply other threads:[~2026-06-16 1:41 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 1:27 [PATCH v1 00/12] perf tests: Enhancements, speedups, and flakiness fixes Ian Rogers
2026-06-16 1:27 ` [PATCH v1 01/12] perf parse-events: Restrict core PMU bypass to --cputype option Ian Rogers
2026-06-16 1:44 ` sashiko-bot
2026-06-16 1:27 ` [PATCH v1 02/12] perf test: Truncate test description to fit terminal width Ian Rogers
2026-06-16 1:38 ` sashiko-bot
2026-06-16 1:27 ` [PATCH v1 03/12] perf tests workloads: Support sub-second durations in noploop and thloop Ian Rogers
2026-06-16 1:35 ` sashiko-bot
2026-06-16 1:27 ` [PATCH v1 04/12] perf tests: Add robust record retry helper and use subsecond workloads Ian Rogers
2026-06-16 1:38 ` sashiko-bot
2026-06-16 1:27 ` [PATCH v1 05/12] perf tests: Skip metrics validation if system-wide recording lacks permission Ian Rogers
2026-06-16 1:41 ` sashiko-bot
2026-06-16 1:27 ` [PATCH v1 06/12] perf tests: Fix Python JIT dump profiling test failure Ian Rogers
2026-06-16 1:39 ` sashiko-bot
2026-06-16 1:27 ` [PATCH v1 07/12] perf tests: Fix flakiness in trace record and replay test Ian Rogers
2026-06-16 1:42 ` sashiko-bot
2026-06-16 1:27 ` [PATCH v1 08/12] perf tests: Fix flakiness in BPF counters test on hybrid systems Ian Rogers
2026-06-16 1:35 ` sashiko-bot
2026-06-16 1:27 ` [PATCH v1 09/12] perf tests: Fix flakiness in branch stack sampling tests Ian Rogers
2026-06-16 1:27 ` [PATCH v1 10/12] perf tests: Speed up off-cpu profiling tests Ian Rogers
2026-06-16 1:41 ` sashiko-bot [this message]
2026-06-16 1:27 ` [PATCH v1 11/12] perf tests: Speed up lock contention analysis shell test Ian Rogers
2026-06-16 1:27 ` [PATCH v1 12/12] perf tests: Speed up metrics checking shell tests Ian Rogers
2026-06-16 6:13 ` [PATCH v2 00/12] perf tests: Enhance robustness, speed up execution, and fix flakiness Ian Rogers
2026-06-16 6:13 ` [PATCH v2 01/12] perf parse-events: Restrict core PMU bypass to --cputype option Ian Rogers
2026-06-16 6:31 ` sashiko-bot
2026-06-16 6:13 ` [PATCH v2 02/12] perf test: Truncate test description to fit terminal width Ian Rogers
2026-06-16 6:24 ` sashiko-bot
2026-06-16 6:13 ` [PATCH v2 03/12] perf tests workloads: Support sub-second durations in noploop and thloop Ian Rogers
2026-06-16 6:22 ` sashiko-bot
2026-06-16 6:13 ` [PATCH v2 04/12] perf tests: Add robust record retry helper and use subsecond workloads Ian Rogers
2026-06-16 6:27 ` sashiko-bot
2026-06-16 6:13 ` [PATCH v2 05/12] perf tests: Skip metrics validation if system-wide recording lacks permission Ian Rogers
2026-06-16 6:13 ` [PATCH v2 06/12] perf tests: Fix Python JIT dump profiling test failure Ian Rogers
2026-06-16 6:27 ` sashiko-bot
2026-06-16 6:13 ` [PATCH v2 07/12] perf tests: Fix flakiness in trace record and replay test Ian Rogers
2026-06-16 6:27 ` sashiko-bot
2026-06-16 6:14 ` [PATCH v2 08/12] perf tests: Fix flakiness in BPF counters test on hybrid systems Ian Rogers
2026-06-16 6:14 ` [PATCH v2 09/12] perf tests: Fix flakiness in branch stack sampling tests Ian Rogers
2026-06-16 6:14 ` [PATCH v2 10/12] perf tests: Speed up off-cpu profiling tests Ian Rogers
2026-06-16 6:25 ` sashiko-bot
2026-06-16 6:14 ` [PATCH v2 11/12] perf tests: Speed up lock contention analysis shell test Ian Rogers
2026-06-16 6:14 ` [PATCH v2 12/12] perf tests: Speed up metrics checking shell tests Ian Rogers
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=20260616014104.563901F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=irogers@google.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.