Where Do Linux and Rust Go From Here? A Group of Kernel Developers Share Their Thoughts
Outstanding Linux Kernel Developers gathered to share insights on the current state and future of nuclear development at a recent roundtable discussion in Open Source Summit Europe in Vienna.
The workshop was hosted by Jonathan Corbet, Linux kernel developer and co-founder of Linux Weekly News (LWN)Featured developers Alice Ryhl, a software engineer at Google on AndroidRust group, Josef Bacik, technical team leader for Metadata‘s kernel filesystem team, Anna-Maria Behnsen, a Linux kernel developer at Linutronix who worked on real-time Linux, and Dan Williams, a member of Intel’s Linux kernel architecture team.
Also: Linus Torvalds Reflects on the Maintainer’s Silver Hair and the Next ‘Linux King’
In short, the board is made up of people from many companies. In the Linux and open source world, people work together across company boundaries all the time. These people are also hired to work on Linux. Some people say you can’t make a living working on open source software and Linux. That’s not true. There’s real money in Linux and Open Source Jobs.
Much of the discussion focused on integration. Rust into the Linux Kernel. In Linux Kernel Maintainer Summit “Some people have been frustrated about the length of time,” Corbet said a day earlier. “I think some people want Rust to take over the world faster than it has.”
At the Maintainer Summit, Linus Torvalds, who loves having Rust in Linuxobserved some features of the nucleus, such as mod versionsTo be currently incompatible with Rust but in progress.
Ryhl, who works with Rust, expressed optimism about the progress despite acknowledging that it will take time for the integration to happen: “There are some things I wish were there and some things that could have happened faster, but things are always going to get better.”
Also: Linux file system structure explained
One problem facing Rust in the Linux kernel, according to Williams, is that “kernel maintainers tend to be very conservative.” They know C from the ground up, but they don’t know Rust. So they “don’t know how to look at this or debug that because they don’t understand the code.”
According to Linux and Rust developer Miguel Ojeda, who spoke at Linux Plumber For the Rust on Linux panel, the answer is to have the maintainers work with the Rust developers for Linux. The maintainers bring their understanding of the subsystem, while the Rust programmers bring their language expertise. By working together, the two groups can help bring Rust code to Linux.
Rhyl agrees: “One approach that has worked for me is to pair up a kernel developer and a Rust expert. I call the maintainer and we go through the patch together. We can learn from each other.”
That’s an example of what can happen when things go well. But sometimes they don’t.
Wedson Almeida, a Microsoft software engineer and one of the Rust for Linux The maintainer, who recently left the project in a note sent to Linux Kernel Mailing List (LKML)He left because, “After nearly four years, I found myself lacking energy and enthusiasm. I have had to answer some non-technical nonsenseSo it’s best to let the people who still have the energy decide.” Ojeda said, though, “The core Rust team is still growing.”
Also: Most popular programming languages in 2024
However, the panel agreed that a positive side effect of everyone working together was that it led to changes in existing C APIs and documentation practices. By getting people to think about how Rust could help Linux, they also had to dig into their own code and explain it.
For example, Al Viro, Linux Virtual File System (VFS) Maintainer Josef Bacik says he has reworked the 65 pages of documentation. This in turn has made the relevant C code much simpler for future developers to migrate to. The documentation now gives clear rules about what the code does and why.
However, the panel also pointed out a key issue: despite thousands of paid kernel developers, none are specifically funded for documentation work. This is a well-known but often overlooked problem. Problems with Linux and Open Source Documentation.
Also: These Linux Distributions Are Best for Developers — Here’s Why
Corbet also noted that some of the tension around documentation stems from the fundamentally different way Rust and C handle the issue:
If you look at how a C API in a kernel design calls it this way, you have to make sure to call it this way and that pointer better not be null, and don’t hit that button there, otherwise the whole thing explodes. The Rust approach is that we’re going to design the API, so your code is probably going to be correct if the compiler lets you call it. C just doesn’t let you do that. But when we’re trying to design Rust APIs for the kernel, they have to sit on top of these C APIs. And so there’s a fundamental mismatch in the approach that’s being taken, and I see it as pushing back to the C APIs and trying to force changes there. I think the changes are good, but I think it creates some resistance from the maintainers of the existing APIs, who have spent decades creating and using those APIs, know where the pitfalls are, and can instinctively avoid them.
Still, while not everyone loves Rust on Linux, progress is being made. At the Maintainer Summit, Torvalds said maintainers don’t need to understand Rust to include it in a subsystem. After all, he pointed out, half-sarcastically, “No one understand the memory management system, but everyone can work with it.”
Also: Linux and Open Source Documentation Is Messy: Here’s the Solution
Ojeda also commented that some Linux distributions, notably Debian And Ubuntuis adopting Rust. In short, he concluded, “Rust is in a good place right now.” Rust may not be coming to Linux as quickly as some would like, but it’s making good progress.