News: 0001626609

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Rust For Linux 7.1 Bringing Experimental Option That Can Help Performance

([Linux Kernel] 70 Minutes Ago Linux 7.1 Rust)


In advance of the Linux 7.1 merge window opening, Miguel Ojeda sent out all of the Rust feature updates on Friday. This includes bumping the minimum Rust version for building the Linux kernel as well as a new experimental option that can provide better performance for Rust code within the kernel, alongside other updates.

As previously covered on Phoronix, [1]the Linux kernel's minimum Rust version is being bumped . Rust 1.85 will be the new baseline for Rust-For-Linux support compared to Rust 1.78 previously. Bindgen 0.71.1 is also now required compared to Bindgen 0.65.1 on prior kernels.

The Rust and Bindgen versions align with what is shipped by the current Debian stable release, Debian Trixie that debuted last August. With Debian stable tending to be the more conservative version, newer releases of Ubuntu / Fedora / openSUSE / etc are all in good shape for meeting/exceeding the new Rust baseline requirements for building the kernel.

The other notable Rust change for Linux 7.1 is the new "CONFIG_RUST_INLINE_HELPERS" Kconfig option for inlining C helpers into Rust. This is a process similar to link-time optimizations (LTO) but limited to just C helpers. This CONFIG_RUST_INLINE_HELPERS option is said to provide a measurable speedup for different workloads, with one example being the Rust null block driver being around 2% faster with the new option enabled.

This inlining of C helpers into Rust does depend upon having LLVM Clang be used as the C compiler for the Linux kernel rather than GCC. The LLVM major version of Clang must also match the Rust compiler version. This is due to relying on LLVM IR linking together with the LLVM IR of the C helpers before the object code is generated. This CONFIG_RUST_INLINE_HELPERS approach works fine for loadable kernel modules too.

The Rust code for Linux 7.1 also includes support for global per-version flags, enhancements to the kernel crate, Rust analyzer improvements, and a variety of other changes. The full list of Rust feature changes for Linux 7.1 can be found via [2]this pull .



[1] https://www.phoronix.com/news/Linux-Preps-For-Rust-1.85-Base

[2] https://lore.kernel.org/rust-for-linux/20260410200429.138694-1-ojeda@kernel.org/



In fact, S. M. Simpson, eventually devised an efficient 24-point Fourier
transform, which was a precursor to the Cooley-Tukey fast Fourier transform
in 1965. The FFT made all of Simpson's efficient autocorrelation and
spectrum programs instantly obsolete, on which he had worked half a lifetime.
-- Proc. IEEE, Sept. 1982, p.900