Revised AVX-512 xor_gen() Implementation For Linux RAID Yielding More Performance Gains
#Hardware

Revised AVX-512 xor_gen() Implementation For Linux RAID Yielding More Performance Gains

Hardware Reporter
2 min read

Eric Biggers has posted a second version of his AVX-512‑accelerated xor_gen() function for the Linux kernel, pushing the RAID5/RAID6 parity‑generation speed up to 43% over the baseline and showing stronger benefits for various source‑count configurations.

The xor_gen() routine is a core building block for Linux software RAID and is also called directly by filesystems such as Btrfs when they need to compute or verify parity blocks. Its performance directly influences rebuild times and overall I/O throughput, making any acceleration noticeable in both desktop and server workloads.

The first AVX-512 version of xor_gen() appeared a few days ago and demonstrated up to a 41% speed increase compared to the generic C implementation. That version used wide 512‑bit registers to process multiple source blocks in parallel, reducing the number of loop iterations required for each parity calculation.

Building on that work, Biggers has now released a v2 implementation that refines the instruction scheduling and improves handling of edge cases where the source count is not a multiple of the vector width. Benchmarks posted to the Linux kernel mailing list show the new code reaching up to a 43% gain over the original scalar path, with even larger improvements for configurations using three or five source disks—scenarios that previously saw smaller benefits from the first AVX-512 patch.

Because xor_gen() is invoked not only by the MD RAID subsystem but also by Btrfs for its RAID5/RAID6 profiles, the performance uplift translates to faster scrub operations, quicker resilvering after a disk failure, and reduced CPU overhead during normal write‑heavy workloads. Filesystems that rely on the kernel’s crypto‑xor helpers for checksumming may also see indirect advantages.

The patch series is currently under review on the kernel mailing list, with developers discussing potential integration targets for the upcoming 6.10 release cycle. If accepted, the updated xor_gen() will provide a measurable performance boost for anyone relying on Linux software RAID or Btrfs without requiring hardware changes.

{{IMAGE:2}}

Community feedback highlights the importance of maintaining backward compatibility while exploiting newer ISA extensions, and the review process will likely address any concerns about fallback paths on CPUs lacking AVX-512 support.

Comments

Loading comments...