RBRD: RAM-Backed Linux Block Driver Written In Rust For Better Safety But Slower Performance

Linux kernel patches were posted tonight for introducing RBRD, the RAM-backed block driver written in the Rust programming language. Linux has the BRD Driver currently that provides a RAM-backed block device driver written in C code for providing a virtual block device. RBRD is now a Rust-based version of this "true" block device implementation in RAM. Granted, with today's memory pricing and availability, RAM-based block device usage is likely limited but still useful for simulations and speedy testing. The RBRD driver unlike the C-based BRD driver ensures that a read and a write copy to the page never occurs at the same time, in order to ensure no undefined behavior in the Rust world. But in turn this makes RBRD slower than BRD for writes, with around a 19% performance hit for a single thread or 22% hit for eight threads. Reads also see a 2~10% performance hit due to these Rust guarantees. The RBRD developers argue the safety is worth the performance cost: "We think this is a small price for page integrity: a RAM disk is still far faster than any real device, and a block device should never return data that was never written. The gap has not been profiled yet, so not all of it is necessarily due to the lock. With a single lock for the whole device instead of one per page, 8-thread reads were 20-28% slower than brd." Those curious can see this patch series for RBRD now out for review on the Linux kernel mailing list.

Original Source

Read the full article at Phoronix →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.