Re: [PATCH] raid6: use normal stores in the x86 x4 xor_syndrome functions
From: Christoph Hellwig
Date: Mon Nov 16 2026 - 01:11:21 EST
On Mon, Nov 09, 2026 at 03:08:05AM +0000, Miroslav Cimerman wrote:
> xor_syndrome() updates P and Q in place for a read-modify-write. md
> calls it twice on the same P/Q page per write, to remove the old data
> and to add the new data. The x1 and x2 unrolled versions write P and Q
> with normal stores since commit a582564b24be ("md/raid6 algorithms:
> xor_syndrome() for SSE2"), which argued that non-temporal stores of
> less than a cache line are slow, but kept non-temporal stores in the
> x4 version, as it writes whole cache lines. The AVX2 and AVX-512
> versions followed the same pattern.
Adding Markus as the author of that commit.
> The non-temporal stores evict P and Q from the cache and the sfence
> waits until they are written to memory, just before the second call
> reads the same P and Q again, now from memory.
>
> Use normal aligned stores in the x4 unrolled versions too, like the x1
> and x2 versions and the other architectures.
>
> md RAID-6, 4 KiB random writes, md thread on one core, Xeon E5-2699 v3:
>
> 8+2 on null_blk (dm-raid): 85.6k -> 98.1k IOPS (+15%)
> 6+2 on 8 Intel Optane M10: 57.3k -> 62.1k IOPS (+8%)
That's pretty nice numbers.
Note that for the new xraid code we'd actually use the XOR code in a
single pass, so non-temporal stores might make some sense. But
I can't good heatedly argue that mainline should care for this right
now.
> - The sfence at the end of the xor_syndrome() functions (x1, x2 versions
> since 2014, x4 with this patch) is no longer needed, as it no longer
> orders any non-temporal stores. Removing it made no measurable
> difference. I am happy to send a follow-up patch that removes it from
> all xor_syndrome() variants.
This probably should go away.
Reviewed-by: Christoph Hellwig <hch@xxxxxx>