At the Linux Plumbers Conference in Richmond, Virginia, Linux and Rust developer Miguel Ojeda gave the Linux kernel developers an update on the state of Rust in the Linux kernel. In brief, Rust Linux is continuing to mature and is getting strong support from developers and vendors, such as Cisco, Samsung, and Canonical.
That evalated position is because, as Microsoft Software Engineer Wedson Almeida Filho said, "We feel that Rust is now ready to join C as a practical language for implementing the kernel. It can help us reduce the number of potential bugs and security vulnerabilities in privileged code, while playing nicely with the core kernel and preserving its performance characteristics."
Today, there are three major Linux Rust toolchains coming together. The first of these is GCC codegen for rustc. This toolchain compiles and can boot mainline Rust and Linux without source code changes.
Then, there's GCC Front-End for Rust, which can be loaded by the existing rustc frontend, but benefits from GCC optimizations. Unfortunately, this project is still very much alpha code. Finally, there's Coccinelle for Rust. Coccinelle is a tool for making large-scale Linux kernel C source code, and Coccinelle for Rust is seeking to bring this power to Rust codebases.
As for the day-to-day work that's required to make Rust fully integrated with Linux, the "official" website of the initiative is now the self-explanatory Rust for Linux. This site is your one-stop source for all things Rust on Linux.
The original rust code branch, where development happened for two years, has been retired. The code is still there, but it's been frozen and archived. Moving forward, rust-next will be the branch that contains new Rust features to be submitted during the next merge window of the Linux kernel. This branch, as the name suggests, is part of Linux Next.
Rust-fixes, meanwhile, is the branch that contains Rust fixes for the current cycle of the Linux kernel. In addition, Rust-dev is an experimental branch for integration purposes. It's a queue for patches that "look good enough" to share and tinker with.
However, the move forward has not been straightforward. Rust on Linux developers have discovered some problems along the way. For example, while deadlocks, when two or more threads are waiting on the other to finish, are safe in Rust, because they don't result in undefined behavior, they're not safe in the Linux kernel. The programmers are working on fixing this issue.
The developers are also worrying about is how to deal with Rust versions. Today, developers can't guarantee that newer Rust versions will work in Linux because the latest version of Rust Linux is compatible with some unstable features. Will these features be there in the next version of Rust? Will they be backward compatible? Stay tuned.
For now, Linux Rust programmers are tracking the latest version of the Rust compiler. That's quite an unusual approach for the kernel, where the name of the game is usually to use old, proven code.
A related issue is that there's growing interest in backporting Rust support into long-term support (LTS) versions of Linux, specifically 5.15 and 6.1. Some people are especially showing interest in the super LTS Linux 6.1 kernel. However, Linux doesn't generally allow backports into LTS Linuxes. So, if you really, really want fully featured Rust support in an older LTS kernel, you're going to need to pay for it in one way or the other.
Another general rule that Rust developers have decided they're going to try to "break" is the rule against duplicate drivers. Usually, no one wants anyone wasting time reinventing the wheel, but some maintainers are open to the idea of experimenting with Rust, by starting simple with a driver they're already familiar with.
Still, others have expressed an interest in writing Rust drivers, but the required abstractions are not there, and merging would break the "no code without an expected in-tree user" rule. So, Ojeda and his merry crew of Rust developers have requested an exception for Rust drivers.
These movements are small steps forward, but they're all critical for making Rust equal to C as a Linux programming language. Based on the high interest I saw at Plumbers, I fully expect that Rust will, eventually, get there.