Re: [PATCH 2/2] xor/kunit: add a benchmark
From: Christoph Hellwig
Date: Thu Jun 18 2026 - 05:28:14 EST
On Wed, Jun 17, 2026 at 05:14:48PM +0000, Eric Biggers wrote:
> The #ifdef can be avoided using kunit_skip(), as the crypto and CRC
> tests do:
>
> if (!IS_ENABLED(CONFIG_XOR_BENCHMARK))
> kunit_skip(test, "not enabled");
I saw that, but what's the point or just not compiling it?
> > + static_assert(ARRAY_SIZE(len_to_test) == 2);
> > + kunit_info(test, "%3u disks:\t%5llu GB/s\t%5llu GB/s\n",
> > + nr, speed[0], speed[1]);
>
> As mentioned in the other thread, this measures the speed at which the
> source data is consumed, which differs from the code in
> lib/raid/xor/xor-core.c that measures the speed at which the destination
> data is produced. Probably best to make them consistent.
The throughput for the generated parity isn't very interesting. It is
the overall throughput that determines the performance. And yes,
the selection benchmark is a complete mess - the single disk XOR is
not a relevant performance metric.