From: sashiko-bot@kernel.org
To: "Arnaldo Carvalho de Melo" <acme@kernel.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 4/4] perf test: Add false_sharing workload exhibiting cross-CPU false sharing
Date: Mon, 28 Sep 2026 22:14:27 +0000 [thread overview]
Message-ID: <20260928221428.4CAA71F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260928220634.2451784-5-acme@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] perf test: fs_reader padding calculation ignores implicit padding
--
commit 3c1c77347e93202ea6f68ec871d8e60e5a4defed
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
perf test: Add false_sharing workload exhibiting cross-CPU false sharing
This commit adds a 'perf test -w false_sharing' workload that hammers a
shared struct from several CPUs, shaped as a TCP connection. The workload
creates threads sharing cache lines to test the data type profiler's
ability to resolve false sharing.
> diff --git a/tools/perf/tests/workloads/false_sharing.c b/tools/perf/tests/workloads/false_sharing.c
> new file mode 100644
> index 0000000000000..12e10d10b87e0
> --- /dev/null
> +++ b/tools/perf/tests/workloads/false_sharing.c
[ ... ]
> +struct fs_reader {
> + pthread_t thread;
> + int cpu;
> + unsigned long sum;
> + char __pad[64 - sizeof(pthread_t) - sizeof(int) - sizeof(unsigned long)];
[Severity: Low]
Does the manual padding computation in struct fs_reader ignore implicit
compiler padding?
On 64-bit architectures, there are 4 bytes of implicit compiler padding
required between the 4-byte cpu and the 8-byte sum. As a result, the struct
fields occupy 68 bytes before the __attribute__((aligned(64))) rounds the
final struct size up to 128 bytes, effectively doubling the intended footprint
and wasting 64 bytes per array element.
> +} __attribute__((aligned(64)));
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260928220634.2451784-1-acme@kernel.org?part=4
next prev parent reply other threads:[~2026-09-28 22:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 22:06 [PATCH v3 0/4] perf tools: Add progress diagnostics and a false-sharing workload Arnaldo Carvalho de Melo
2026-09-28 22:06 ` [PATCH 1/4] perf config: Move perf_config__set_variable() to util/config.c Arnaldo Carvalho de Melo
2026-09-28 22:19 ` sashiko-bot
2026-09-28 22:06 ` [PATCH 2/4] perf report: Add --progress option Arnaldo Carvalho de Melo
2026-09-28 22:12 ` sashiko-bot
2026-09-29 18:29 ` Namhyung Kim
2026-09-28 22:06 ` [PATCH 3/4] perf scripts: Add perf-stuck, to tell where a running perf is stuck Arnaldo Carvalho de Melo
2026-09-28 22:16 ` sashiko-bot
2026-09-29 18:31 ` Namhyung Kim
2026-09-28 22:06 ` [PATCH 4/4] perf test: Add false_sharing workload exhibiting cross-CPU false sharing Arnaldo Carvalho de Melo
2026-09-28 22:14 ` sashiko-bot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-09-28 16:22 [PATCH 0/4 v1] perf tools: Add progress diagnostics and a false-sharing workload Arnaldo Carvalho de Melo
2026-09-28 16:22 ` [PATCH 4/4] perf test: Add false_sharing workload exhibiting cross-CPU false sharing Arnaldo Carvalho de Melo
2026-09-28 16:31 ` sashiko-bot
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=20260928221428.4CAA71F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=acme@kernel.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