In October of this year, the initial Rust infrastructure was merged into Linux 6.1. Means that the Rust programming language will be used for code in kernel drivers and other subsystems in the future. But October’s Rust for Linux only provided the low-level infrastructure and some very basic integrations, missing a lot of specification and subsystem abstractions.
Recently, Miguel Ojeda, who leads the Rust for Linux work, released a set of optimization patches (28) that provide more Rust core support code for the kernel.
Ojeda explained in the patch series emails:
This patch series is the first changes to upstream Rust support, all introduced facilities are part of “Rust core” and will not interact with the C side (no new C types are used; only
strlen
,memchr
additional error codes and some moreprintk
format string).The main content of this series of patches:
- Let
str.rs
andprint.rs
Synchronize with downstream- Add remaining proc macros
- Let
error.rs
more complete, although more will come laterpub(crate)
function (to avoid leaving dead code between series).Additionally, this series of patches uses some temporary
#[allow(dead_code)]
properties to allow more freedom in organizing patches while keeping all patches buildable without warnings/errors. But these properties are only used temporarily, and there are not many left when the series patch is finally released.
This batch of patches has almost all code in linux-next for several months, is part of the Rust patch series, and each patch is enabling Rust’s defconfig
Tested the build on . Given the completeness of its testing, this batch of patches will most likely make it into the Linux 6.2 merge window.
Once all the Rust infrastructure is in place, some hardware drivers will start to be converted to Rust code, and some C driver code will also be rewritten in Rust. According to foreign media Phoronix, one of the first major users of Rust for Linux should be the DRM driver for Apple M1/M2 graphics.
#Linux #kernel #receives #batch #Rust #infrastructure #optimization #patches #News Fast Delivery