mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Hindborg <a.hindborg@kernel.org>
To: Vitaly Wool <vitaly.wool@konsulko.se>, Jens Axboe <axboe@kernel.dk>
Cc: "Boqun Feng" <boqun@kernel.org>,
	"Miguel Ojeda" <ojeda@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Tamir Duberstein" <tamird@kernel.org>,
	"Alexandre Courbot" <acourbot@nvidia.com>,
	"Onur Özkan" <work@onurozkan.dev>,
	"Lorenzo Stoakes" <ljs@kernel.org>,
	"Liam R. Howlett" <liam@infradead.org>,
	linux-block@vger.kernel.org, rust-for-linux@vger.kernel.org,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	"Vitaly Wool" <vitaly.wool@konsulko.se>
Subject: Re: [PATCH v3 0/3] rust: block: add rbrd, a RAM backed block driver
Date: Fri, 04 Dec 2026 14:56:03 +0100	[thread overview]
Message-ID: <87wlpp5evg.fsf@t14s.mail-host-address-is-not-set> (raw)
In-Reply-To: <20261204114147.243508-1-vitaly.wool@konsulko.se>

"Vitaly Wool" <vitaly.wool@konsulko.se> writes:

> This series adds rbrd, a RAM backed block driver written in Rust that
> works like brd, together with the Rust abstractions it needs:
>
> 1) a `Guarded` page kind: a reference counted page whose data is only
>    accessed under a bit spinlock in `page->private`. A guard gives
>    access to the page data as a byte slice while the lock is held, and
>    `try_get_raw()` takes a speculative reference for lock-free lookups;
> 2) a `discard_granularity` option for `GenDiskBuilder`;
> 3) the driver itself, configured through configfs like rnull. Its pages
>    are kept in a flat array of atomic page pointers, so finding, adding
>    or removing a page takes no lock.
>
> Unlike brd, rbrd never lets a read and a write copy the same page at
> the same time: each copy holds the page's bit spinlock. brd allows
> this race, so a read that overlaps a write can return a torn mix of
> old and new data. In Rust the race would also be undefined behaviour.
>
> This guarantee costs very little now. Under parallel load rbrd matches
> brd: with 16 or more threads, writes run at 98-100% of brd's rate, and
> 64k I/O runs at 99-103% (O_DIRECT, 1 GiB device, 24 vCPU KVM guest on
> a Xeon host pinned to one NUMA node, both drivers on the same kernel,
> median of 3 boots, kIOPS):
>
>   test                   brd    rbrd   rbrd/brd
>   write 4k, 16 threads  5572    5468     98%
>   write 4k, 48 threads  5444    5333     98%
>   randwrite 4k, 24 thr  5797    5789    100%
>   randwrite 4k, 48 thr  5727    5735    100%
>   read 64k, 24 threads   264     270    102%
>   read 64k, 48 threads   262     266    102%
>   write 64k, 24 threads  258     259    101%
>   randwrite 64k, 24 thr  263     270    103%
>
> rbrd was stress tested with data verification on 4k and 512-byte
> block devices while a third device was created, used and removed in a
> loop, on a normal kernel and on a KASAN, lockdep and kmemleak build:
> no errors, no leaks and a clean dmesg. The Rust doctests, including
> the new `alloc_guarded()` example, pass.
>

Similar to v2 I only got 0/3 and 1/3 for this one.


Best regards,
Andreas Hindborg




      parent reply	other threads:[~2026-12-04 13:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa13ARdKL5OYuXv9S-eD3fhky6EHzhsjGd63rbKIKB2eU5maDu27y5fYXoKHreORr9Bb2c7I-xPT0OdY9bQKdA==@protonmail.internalid>
2026-12-04 11:41 ` Vitaly Wool
2026-12-04 11:41   ` [PATCH v3 1/3] rust: page: add guarded pages Vitaly Wool
2026-12-04 13:56   ` Andreas Hindborg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wlpp5evg.fsf@t14s.mail-host-address-is-not-set \
    --to=a.hindborg@kernel.org \
    --cc=acourbot@nvidia.com \
    --cc=aliceryhl@google.com \
    --cc=axboe@kernel.dk \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=liam@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    --cc=vitaly.wool@konsulko.se \
    --cc=work@onurozkan.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®