From: sashiko-bot@kernel.org
To: "James Clark" <james.clark@linaro.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v5 09/19] perf test: Add named_threads workload
Date: Tue, 09 Jun 2026 16:00:00 +0000 [thread overview]
Message-ID: <20260609160001.2739E1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609-james-cs-context-tracking-fix-v5-9-d53a7d096a19@linaro.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The test workload loop is optimized away by the compiler, contains a C11 data race on a shared variable, and contradicts its commit message.
--
commit dcd726ac63da1e487f029b2a3e5128fec278becd
Author: James Clark <james.clark@linaro.org>
perf test: Add named_threads workload
This commit adds a new workload to perf tests that runs multiple threads,
each executing a unique function that loops and sets its thread name. It
is intended to test processor trace decoding for concurrent threads.
> perf test: Add named_threads workload
>
> Add a workload that runs X threads that run a unique function named
> "named_threads_thread[x]" which performs a multiplication in a loop for
[Severity: Low]
The commit message mentions performing a multiplication, but the
implementation uses addition. Is this the intended behavior?
> Y loops. Each thread sets its name to "thread[x]".
[ ... ]
> diff --git a/tools/perf/tests/workloads/Build b/tools/perf/tests/workloads/Build
> index 90f2d8aa4941f..75b377934a0e6 100644
> --- a/tools/perf/tests/workloads/Build
> +++ b/tools/perf/tests/workloads/Build
> @@ -2,6 +2,7 @@
>
> perf-test-y += noploop.o
> perf-test-y += thloop.o
> +perf-test-y += named_threads.o
[Severity: Medium]
In tools/perf/tests/workloads/Build, unlike other loop workloads in this
directory, there is no CFLAGS_named_threads.o = -O0 override.
Without this, will the compiler optimize the loop away into a single
arithmetic operation and remove the branch instructions this test relies on?
> perf-test-y += leafloop.o
[ ... ]
> diff --git a/tools/perf/tests/workloads/named_threads.c b/tools/perf/tests/workloads/named_threads.c
> new file mode 100644
> index 0000000000000..d051d41a3cfe4
> --- /dev/null
> +++ b/tools/perf/tests/workloads/named_threads.c
[ ... ]
> +#define DEFINE_THREAD(n) \
> +noinline void *named_threads_thread##n(void *arg __maybe_unused) \
> +{ \
> + pthread_setname_np(pthread_self(), "thread" #n); \
> + for (int i = 0; i < iterations; i++) \
> + named_threads_work += 3; \
[Severity: Medium]
In DEFINE_THREAD() within tools/perf/tests/workloads/named_threads.c,
named_threads_work is a shared global variable accessed concurrently by
multiple threads.
Without atomic operations or locks, does this introduce a data race?
This might trigger ThreadSanitizer test failures during execution.
> + \
> + return NULL; \
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260609-james-cs-context-tracking-fix-v5-0-d53a7d096a19@linaro.org?part=9
next prev parent reply other threads:[~2026-06-09 16:00 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 14:40 [PATCH v5 00/19] perf cs-etm: Queue context packets for frontend James Clark
2026-06-09 14:40 ` [PATCH v5 01/19] " James Clark
2026-06-09 14:40 ` [PATCH v5 02/19] perf test: Add workload-ctl option James Clark
2026-06-09 14:40 ` [PATCH v5 03/19] perf test: Add a workload that forces context switches James Clark
2026-06-09 14:40 ` [PATCH v5 04/19] perf test cs-etm: Test process attribution James Clark
2026-06-09 14:40 ` [PATCH v5 05/19] perf test: Add deterministic workload James Clark
2026-06-09 14:40 ` [PATCH v5 06/19] perf test cs-etm: Replace unroll loop thread with deterministic decode test James Clark
2026-06-09 17:04 ` Leo Yan
2026-06-09 14:40 ` [PATCH v5 07/19] perf test cs-etm: Remove asm_pure_loop test James Clark
2026-06-09 14:40 ` [PATCH v5 08/19] perf test cs-etm: Replace memcpy test with raw dump stress test James Clark
2026-06-09 17:16 ` Leo Yan
2026-06-09 14:40 ` [PATCH v5 09/19] perf test: Add named_threads workload James Clark
2026-06-09 16:00 ` sashiko-bot [this message]
2026-06-09 14:40 ` [PATCH v5 10/19] perf test cs-etm: Test decoding for concurrent threads test James Clark
2026-06-09 17:18 ` Leo Yan
2026-06-09 14:40 ` [PATCH v5 11/19] perf test cs-etm: Remove duplicate branch tests James Clark
2026-06-09 14:40 ` [PATCH v5 12/19] perf test cs-etm: Skip if not root James Clark
2026-06-09 16:13 ` sashiko-bot
2026-06-09 14:40 ` [PATCH v5 13/19] perf test cs-etm: Reduce snapshot size James Clark
2026-06-09 14:40 ` [PATCH v5 14/19] perf test cs-etm: Speed up basic test James Clark
2026-06-09 14:40 ` [PATCH v5 15/19] perf test cs-etm: Remove unused Coresight workloads James Clark
2026-06-09 17:22 ` Leo Yan
2026-06-09 14:40 ` [PATCH v5 16/19] perf test cs-etm: Make disassembly test use kcore James Clark
2026-06-09 14:40 ` [PATCH v5 17/19] perf test cs-etm: Add all branch instructions to test James Clark
2026-06-09 14:40 ` [PATCH v5 18/19] perf test cs-etm: Speed up disassembly test James Clark
2026-06-09 16:48 ` sashiko-bot
2026-06-09 14:40 ` [PATCH v5 19/19] perf test cs-etm: Move existing tests to coresight folder James Clark
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=20260609160001.2739E1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=james.clark@linaro.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox