Rust for Linux has brought in Rust as a second programming language in the Linux Kernel, with initial support merged in December 2022 with kernel 6.1. Since then, the community has been making good progress towards building a general framework for writing Linux kernel device drivers in safe Rust.
In this talk we take a closer look at some of the challenges we have encountered while making the kernel block device driver APIs available to Rust consumers. We dive into how the Rust block device driver is different from the C APIs, and the guarantees for correctness that the Rust APIs provide. We discuss how these safety guarantees some times come with additional overhead (although minimal, as demonstrated), and why the overheads are necessary to gain the benefits provided by safe Rust code.
Andreas HINDBORG