A key performance enhancement for the RISC-V architecture has been merged into the Linux 7.4 kernel, addressing limitations present in previous versions. While an earlier optimization introduced in Linux 7.3 allowed kernels to skip software alignment for hardware supporting fast misaligned memory copies, it required this support to be compiled directly into the kernel. This compile-time requirement hindered portability, making it difficult for generic RISC-V builds to utilize the feature across diverse hardware configurations where some devices might not support efficient unaligned accesses.

With the arrival of Linux 7.4, the mechanism for skipping software alignment has been shifted to runtime detection. The kernel now checks for the "HAVE_EFFICIENT_UNALIGNED_ACCESS" capability dynamically when handling user copies. This change allows distribution kernels and other generic builds to include the optimization universally, ensuring that systems with compatible hardware automatically benefit from improved performance without requiring specific compilation flags.

Testing conducted by Tenstorrent, who originally contributed the optimization for Linux 7.3, indicated bandwidth improvements of up to 11% when this feature is active. Beyond this user copy enhancement, the RISC-V pull request for Linux 7.4 includes several other updates. These additions encompass support for crash hot-plug, optimized code paths for certain page table functions, and context switching improvements. Furthermore, the update integrates the "B" RISC-V ISA extension into hwcap and hwprobe reporting, alongside support for reporting the RISC-V Zic64b ISA extension.

Sources: Phoronix.