Re: [PATCH] raid6: use normal stores in the x86 x4 xor_syndrome functions

From: Eric Biggers

Date: Mon Nov 16 2026 - 16:04:52 EST


On Mon, Nov 09, 2026 at 03:08:05AM +0000, Miroslav Cimerman wrote:
> - 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.

Removing the 'asm volatile("sfence" : : : "memory");' too sounds good,
but be careful: a lot of the inline asm statements in
lib/raid/raid6/x86/avx512.c incorrectly list the memory operands as
inputs only. So, technically they rely on that "memory" clobber. The
constraints should be fixed accordingly.

Also, ideally the 'prefetchnta' on q in the x4 xor_syndrome() functions
would become 'prefetcht0', to match the temporal stores.

If the scope of this patch is just replacing the store instructions
though, it looks fine.

Reviewed-by: Eric Biggers <ebiggers@xxxxxxxxxx>

- Eric