Rust Null Block Driver Published To Begin Experimenting With Rust For Linux Storage

Written by Michael Larabel in Linux Storage on 3 May 2023 at 05:53 AM EDT. 161 Comments
LINUX STORAGE
To help facilitate the exploration of the Rust programming language for Linux storage purposes within the kernel, Samsung engineer Andreas Hindborg has published a null block driver written in this memory-safe programming language.

The Rust null block driver is intended to serve for evaluating of Rust bindings for the kernel's block layer, expose Rust to more Linux storage developers, and serve similar purposes for helping "kick the tires" around Rust and Linux storage drivers.

Andreas Hindborg wrote in the announcement of this new Rust driver:
"Being small and simple, the null block driver is a good place to introduce the Linux kernel storage community to Rust. This will help prepare the community for future Rust projects and facilitate a better maintenance process for these projects.

The statistics presented in my previous message show that the C null block driver has had a significant amount of memory safety related problems in the past. 41% of fixes merged for the C null block driver are fixes for memory safety issues. This makes the null block driver a good candidate for rewriting in Rust.
...
In this table each cell shows the relative performance of the Rust driver to the C driver with the throughput of the C driver in parenthesis: `rel_read rel_write (read_miops write_miops)`. Ex: the Rust driver performs 4.74 percent better than the C driver for fio randread with 2 jobs at 16 KiB block size.

Over the 432 benchmark configurations, the relative performance of the Rust driver to the C driver (in terms of IOPS) is between 6.8 and -11.8 percent with an average of 0.2 percent better for reads. For writes the span is 16.8 to -4.5 percent with an average of 0.9 percent better."

The Rust null block driver does support BLK-MQ multi-queue already, direct completion of I/O, read/write requests, optional memory backing, and more. There still though are other features to make this driver comparable to the existing C-based null block driver such as NUMA support, bio-based submission, I/O scheduler configuration, zoned storage support, and more.

More details on this early Rust null block layer driver for helping further along the Rust programming language for Linux storage can be found via this patch series.
Related News
About The Author
Michael Larabel

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