Skip to content

lib/raid: opt out of initializing MXCSR and 387 state

Eric Biggers linux-crypto linux-raid linux-um 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3um: Define kernel_fpu_begin_mask()arch/um/include/asm/fpu/api.h+1 -01 reply
2/3xor: opt out of initializing MXCSR and 387 statelib/raid/xor/x86/xor-avx.c lib/raid/xor/x86/xor-avx512.c lib/raid/xor/x86/xor-sse.c+4 -40 replies
3/3raid6: opt out of initializing MXCSR and 387 statelib/raid/raid6/x86/avx2.c lib/raid/raid6/x86/avx512.c lib/raid/raid6/x86/recov_avx2.c +3 more+24 -240 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchChristoph Hellwig
SeriesR-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] lib/raid: opt out of initializing MXCSR and 387 state

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/[email protected]/).
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

Signature · 1 line
2.56.1