Rust Code For The Linux Kernel Updated With More Features Implemented

Written by Michael Larabel in Programming on 2 August 2022 at 06:10 AM EDT. 16 Comments
PROGRAMMING --
Miguel Ojeda has posted the newest patch series implementing the Rust programming language infrastructure and initial sample code for the Linux kernel.

Rust support v8 was posted today with the initial 43.6k lines of code adding the Rust programming language support for optional use inside the Linux kernel.

Back in June at the Open-Source Summit, Linus Torvalds commented that Rust for the kernel could be merged for Linux 5.20 - now known as Linux 6.0. It remains to be seen if that will still happen, especially as the v8 patch series posted today has many new additions and will need more time for review... So short of it being a last-minute merge next week for Linux 6.0, the Rust kernel code may still take more time to bake. In any event it seems to be inching ever so close to merging.


With the Rust v8 patch series for the Linux kernel there is a lot of code churn with more kernel functionality now being accessible from Rust code. Some of the Rust highlights with these newest patches include:

- Upgrading the toolchain against Rust 1.62.

- Moving the Rust Linux kernel bindings to their own crate (named "bindings") to improve build times when only the kernel crate changes.

- Improvements to the speed for running rust-analyzer.

- File-system support was added with the "fs" module including various new types, file-system parameters support, file-system flags, and file-system sample code in Rust.

- Workqueues support is also new with the Rust v8 Linux patches.

- Expanded asynchronous support for the Rust v8 patches now in having executor support, a workqueue-based executor, yield_now() that yields execution of the current task, and an asynchronous TCP echo server sample is added.

- Rust support for handling of interrupts.

- Initial RCU support.

- Initial support for delays/sleeps.

As for the current status, the v8 patch series still carries this message: "The Rust support is still to be considered experimental. However, support is good enough that kernel developers can start working on the Rust abstractions for subsystems and write drivers and other modules."

More details for those interested in Rust for the Linux kernel can see the v8 patches on the kernel mailing list.
Related News
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week