Linux 7.4 makes a RISC-V memory copy optimization portable

Translated by a model; the original is in Russian.

· Linux and open source
The RISC-V architecture changes have been merged into Linux 7.4. The main one moves the decision to skip software alignment during memory copies to run time, so distribution kernel builds can now use the optimization.

cover.svg

The RISC-V architecture changes have landed in the Linux 7.4 kernel. The most notable one improves the performance of copying data between user space and the kernel.

What Linux 7.3 did

In Linux 7.3, Tenstorrent added an optimization for RISC-V hardware that can copy data to and from misaligned addresses quickly. On such processors, the kernel can skip software alignment. In Tenstorrent's tests, bandwidth improved by up to 11%.

The approach had a limitation: the support had to be enabled when the kernel was compiled. As a result, builds targeting a range of hardware could not use it. Some RISC-V systems lack fast misaligned access, and a generic kernel cannot assume the capability is present.

What changes in Linux 7.4

The decision to skip software alignment on hardware with "HAVE_EFFICIENT_UNALIGNED_ACCESS" is now made at run time. The kernel detects whether the processor supports fast unaligned access and, if it does, skips alignment when copying data from user space.

This means distribution RISC-V kernels and other generic builds, which previously left the optimization out, can now benefit from it.

Other changes

Faster user copies are only one of the RISC-V changes in Linux 7.4. The release also brings:

  • support for crash hot-plug;
  • optimized code paths for some page table functions;
  • an optimization during context switching;
  • reporting of the "B" ISA extension through hwcap and hwprobe;
  • support for reporting the Zic64b ISA extension.

Source: Phoronix

Comments

Sign in, to comment.

  • No comments yet.