From: sashiko-bot@kernel.org
To: "Christoph Hellwig" <hch@lst.de>
Cc: yukuai@fygo.io, linux-raid@vger.kernel.org
Subject: Re: [PATCH 4/8] xor/kunit: add a benchmark
Date: Wed, 15 Jul 2026 15:05:08 +0000 [thread overview]
Message-ID: <20260715150508.F03D41F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260715144825.95432-5-hch@lst.de>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Unbounded preemption-disabled region in `xor_benchmark` causes softlockup panics and RCU stall warnings on slower architectures.
--
--- Patch [4]: [PATCH 4/8] xor/kunit: add a benchmark ---
commit f403ad2f80a6eb7a690f9b948152ad30281caf15
Author: Christoph Hellwig <hch@lst.de>
xor/kunit: add a benchmark
This commit adds a benchmark to the XOR KUnit test suite to evaluate
performance across varying block sizes and numbers of disks. The benchmark
reports runtime speeds in GB/s.
> diff --git a/lib/raid/xor/tests/xor_kunit.c b/lib/raid/xor/tests/xor_kunit.c
> --- a/lib/raid/xor/tests/xor_kunit.c
> +++ b/lib/raid/xor/tests/xor_kunit.c
[ ... ]
> +static void xor_benchmark(struct kunit *test)
> +{
[ ... ]
> + for (j = 0; j < ARRAY_SIZE(len_to_test); j++) {
> + unsigned int len = len_to_test[j];
> + const unsigned long num_iters = 1000;
> +
> + KUNIT_ASSERT_GT(test, len, 0);
> + KUNIT_ASSERT_LE(test, len, XOR_KUNIT_MAX_BYTES);
> +
> + preempt_disable();
> + t = ktime_get_ns();
> + for (l = 0; l < num_iters; l++)
> + xor_gen(test_dest, test_buffers, nr, len);
> + t = max(ktime_get_ns() - t, 1);
> + preempt_enable();
[Severity: High]
Will this preemption-disabled region cause softlockup panics or RCU stalls
on slower architectures?
In xor_benchmark(), preempt_disable() is called before processing 1,000
iterations of up to 32 blocks of 16KB each. On a slow emulated architecture
without hardware acceleration, this loop will synchronously process over
500 MB of memory.
If the memory bandwidth is low enough, could this tight loop exceed the
default 20-second softlockup and 21-second RCU stall timeouts, resulting
in a kernel panic during CI testing?
Would it be safer to place the preemption-disabled block inside the
iteration loop and accumulate the time, or dynamically scale the number
of iterations based on a time threshold so the scheduler has a chance to run?
> +
> + speed[j] = div64_u64((u64)len * num_iters * nr, t);
> + }
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260715144825.95432-1-hch@lst.de?part=4
next prev parent reply other threads:[~2026-07-15 15:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 14:47 misc lib/raid/ improvements v2 Christoph Hellwig
2026-07-15 14:47 ` [PATCH 1/8] xor: enable lock context analysis Christoph Hellwig
2026-07-15 14:47 ` [PATCH 2/8] xor: improve the runtime selection benchmark Christoph Hellwig
2026-07-15 15:04 ` sashiko-bot
2026-07-15 14:47 ` [PATCH 3/8] xor/kunit: fix a spelling error Christoph Hellwig
2026-07-15 14:47 ` [PATCH 4/8] xor/kunit: add a benchmark Christoph Hellwig
2026-07-15 15:05 ` sashiko-bot [this message]
2026-07-15 14:47 ` [PATCH 5/8] raid6: enable lock context analysis Christoph Hellwig
2026-07-15 14:47 ` [PATCH 6/8] raid6: defer implementation selection when built-in Christoph Hellwig
2026-07-15 14:47 ` [PATCH 7/8] raid6: improve the runtime selection benchmark Christoph Hellwig
2026-07-15 14:59 ` sashiko-bot
2026-07-15 14:47 ` [PATCH 8/8] raid6/kunit: add a benchmark Christoph Hellwig
2026-07-15 15:01 ` sashiko-bot
-- strict thread matches above, loose matches on Subject: below --
2026-07-08 9:07 misc lib/raid/ improvements Christoph Hellwig
2026-07-08 9:07 ` [PATCH 4/8] xor/kunit: add a benchmark Christoph Hellwig
2026-07-08 9:22 ` sashiko-bot
2026-07-08 9:05 misc lib/raid/ improvements Christoph Hellwig
2026-07-08 9:05 ` [PATCH 4/8] xor/kunit: add a benchmark Christoph Hellwig
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=20260715150508.F03D41F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=hch@lst.de \
--cc=linux-raid@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=yukuai@fygo.io \
/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