From: Eric Biggers <ebiggers@kernel.org>
To: akpm@linux-foundation.org, linux-raid@vger.kernel.org
Cc: linux-crypto@vger.kernel.org, x86@kernel.org,
Christoph Hellwig <hch@lst.de>,
Richard Weinberger <richard@nod.at>,
Anton Ivanov <anton.ivanov@cambridgegreys.com>,
Johannes Berg <johannes@sipsolutions.net>,
Eric Biggers <ebiggers@kernel.org>
Subject: [PATCH 0/3] lib/raid: opt out of initializing MXCSR and 387 state
Date: Wed, 11 Nov 2026 12:56:01 -0800 [thread overview]
Message-ID: <20261111205604.47547-1-ebiggers@kernel.org> (raw)
This series slightly reduces the overhead of the x86 kernel-mode "FPU"
sections in the RAID code by using kernel_fpu_begin_mask(0) instead of
kernel_fpu_begin(), thus opting out of the 'ldmxcsr' (and on 32-bit
kernels, also 'fninit'). MXCSR is irrelevant for integer code.
This mirrors similar optimizations for the crypto and CRC code
(https://lore.kernel.org/linux-crypto/20261105005523.84925-1-ebiggers@kernel.org/).
It's more important there than in the RAID code, since short lengths are
common in the x86-optimized crypto and CRC functions. However, I think
it's worth updating the RAID code too for consistency.
Unlike the crypto and CRC code, the RAID code is built for user-mode
Linux. Therefore, as a prerequisite for this change, patch 1 also
defines a stub for kernel_fpu_begin_mask() on user-mode Linux.
This series is targeting mm/mm-nonmm-unstable.
Eric Biggers (3):
um: Define kernel_fpu_begin_mask()
xor: opt out of initializing MXCSR and 387 state
raid6: opt out of initializing MXCSR and 387 state
arch/um/include/asm/fpu/api.h | 1 +
lib/raid/raid6/x86/avx2.c | 12 ++++++------
lib/raid/raid6/x86/avx512.c | 12 ++++++------
lib/raid/raid6/x86/recov_avx2.c | 4 ++--
lib/raid/raid6/x86/recov_avx512.c | 4 ++--
lib/raid/raid6/x86/recov_ssse3.c | 4 ++--
lib/raid/raid6/x86/sse2.c | 12 ++++++------
lib/raid/xor/x86/xor-avx.c | 2 +-
lib/raid/xor/x86/xor-avx512.c | 2 +-
lib/raid/xor/x86/xor-sse.c | 4 ++--
10 files changed, 29 insertions(+), 28 deletions(-)
base-commit: d0ad02b9d5dd7ae551f450cfd233f3e28bbf59d3
--
2.56.1
next reply other threads:[~2026-11-11 20:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 20:56 Eric Biggers [this message]
2026-11-11 20:56 ` [PATCH 1/3] um: Define kernel_fpu_begin_mask() Eric Biggers
2026-11-12 7:28 ` Johannes Berg
2026-11-11 20:56 ` [PATCH 2/3] xor: opt out of initializing MXCSR and 387 state Eric Biggers
2026-11-11 20:56 ` [PATCH 3/3] raid6: " Eric Biggers
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=20261111205604.47547-1-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=anton.ivanov@cambridgegreys.com \
--cc=hch@lst.de \
--cc=johannes@sipsolutions.net \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=richard@nod.at \
--cc=x86@kernel.org \
/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