All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Miroslav Cimerman <mc@raidlab.org>
Cc: Song Liu <song@kernel.org>, Yu Kuai <yukuai@fygo.io>,
	Andrew Morton <akpm@linux-foundation.org>,
	Li Nan <magiclinan@didiglobal.com>, Xiao Ni <xiao@kernel.org>,
	Ard Biesheuvel <ardb@kernel.org>,
	Eric Biggers <ebiggers@kernel.org>,
	linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org,
	Markus Stockhausen <stockhausen@collogia.de>
Subject: Re: [PATCH] raid6: use normal stores in the x86 x4 xor_syndrome functions
Date: Sun, 15 Nov 2026 22:11:13 -0800	[thread overview]
Message-ID: <avqegZd_W0kce0UA@infradead.org> (raw)
In-Reply-To: <20261109030805.25709-1-mc@raidlab.org>

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@lst.de>

  parent reply	other threads:[~2026-11-16  6:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-09  3:08 [PATCH] raid6: use normal stores in the x86 x4 xor_syndrome functions Miroslav Cimerman
2026-11-12 12:21 ` Miroslav Cimerman
2026-11-12 12:33   ` Anton Gavriliuk
2026-11-16  6:11 ` Christoph Hellwig [this message]
2026-11-16  6:39   ` AW: " Markus Stockhausen
2026-11-16 21:04 ` Eric Biggers
2026-11-16 22:14   ` David Laight

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=avqegZd_W0kce0UA@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=ebiggers@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=magiclinan@didiglobal.com \
    --cc=mc@raidlab.org \
    --cc=song@kernel.org \
    --cc=stockhausen@collogia.de \
    --cc=xiao@kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.