Rust is expected to complement the C language as a new language to support Linux kernel driver development.
Rust for Linux v9 is much smaller than previous patches due to the removal of many extra features and integrations. It is expected to bring more positive changes to the mainline kernel by sticking to a more initial “minimum route”.
In addition to enhancing integration and build transactions, it also allows specific patches to various abstractions and subsystems, leading to more participation in code review and feedback.Lead developer Miguel Ojeda commented:
As a ‘lite’ version of the v8 patch, v9 provides enough support for compiling a minimal Rust kernel module – with a view to being the first to get ‘core’ support, and to start gradually ‘upstreaming’ the rest.
A kernel module can create a ‘vector’ as a contiguous, growable array type that can push some numbers and print it to the kernel log when unloaded using the ‘pr_info!’ macro.
The new patch series can also be made smaller by removing parts of it, which seems to strike a good balance so far.
We ended up with 3% kernel crate retention (reduced to 500 lines) and 60% alloc and adapt alloc commits (100 lines), reducing the overall volume from 40k to 13k lines.
While most of the code has been in linux-next for months, we had to make minor changes to reduce some content, and finally welcome feedback on whether this option is what you expect.
PhoronixNoting that with the significant reduction in patch volume for v9, it is expected to be easier to obtain mainline licensing than before.
Linus Torvalds has been hoping to complete the merge as soon as possible (next week’s Linux 6.0 merge window) and will see if the work is good enough.