mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Almeida <daniel.almeida@collabora.com>
To: Danilo Krummrich <dakr@kernel.org>
Cc: "Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org
Subject: Re: [PATCH] rust: add a ring buffer implementation
Date: Mon, 16 Feb 2026 11:46:20 -0300	[thread overview]
Message-ID: <71F89D79-DBE1-4617-B58A-8552D0F2B3A2@collabora.com> (raw)
In-Reply-To: <DGGGPFU9E9VD.8TT3HZUWS100@kernel.org>



> On 16 Feb 2026, at 11:39, Danilo Krummrich <dakr@kernel.org> wrote:
> 
> On Mon Feb 16, 2026 at 3:21 PM CET, Daniel Almeida wrote:
>> 
>> 
>>> On 16 Feb 2026, at 11:06, Danilo Krummrich <dakr@kernel.org> wrote:
>>> 
>>> On Mon Feb 16, 2026 at 2:45 PM CET, Daniel Almeida wrote:
>>>> With the allocation being handled by a separate component, I don’t think
>>>> this is right. I think a better location is rust/kernel/io
>>> 
>>> I'm not sure it is reasonable to ask people who just want a ringbuffer in system
>>> memory to take the indirection over an I/O ringbuffer implementation with
>>> generic I/O backends choosing the system memory I/O backend.
>>> 
>>> The proposed code is simple, without comments and tests, less than 100 lines of
>>> code. The I/O infrastructure to make this happen is still WIP. So, I think it's
>>> fine to land it as VecDeque for now.
>> 
>> 
>> Well, this is a 100 line patch, but nothing was said of how much else was going
>> to be added on top in the future. In order to avoiding iterating on what I
>> consider the wrong approach, I suggested that we start out in the right
>> direction from the start, something that Andreas himself apparently agreed to.
> 
> I haven't seen any commitment to implement this in terms of generic I/O backends
> from Andreas.
> 
>>> Once we have the I/O backend infrastructure, a system memory I/O backend that
>>> can deal with separate allocators *and* a ring buffer implementation that sits
>>> on top of it, we can still revisit if it makes sense to take advantage of
>>> synergies.
>>> 
>>> But for now this seems a bit premature in terms of delaying Andreas' work.
>> 
>> IIUC, and feel free to correct me on this, the I/O backends are already in the
>> works. What is missing is a trivial system memory backend, and similarly a
>> ringbuffer implementation, which is the subject of this patch. I don't see this
>> as a lot of work or an unreasonable ask.
> 
> I think you are highly underestimating the consequences of this design.

Might very well be the case, yeah.

> 
> First of all, we're missing IoView (the generalization of IoSlice), which also
> supports projection. Gary is working on this, but it is completely unclear when
> it will land.
> 
> Second, the system memory backend would have to be implemented and needs to be
> generic over arbitrary allocators. Also note that I/O backends do *not*
> implement growing and shrinking of the backing memory, which would be another
> limitation for a derived VecDeque type to swallow. Alternatively, it is yet
> another thing we have to implement.
> 
> Then we have to implement the I/O ringbuffer type, which, due to being generic
> over I/O backends, also has to consider the device lifecycle requirements for
> the corresponding I/O backend, which is additional complexity as well.
> 
> So, don't get me wrong, it is a good idea and exactly in the sense of my vision
> of how powerful I want the I/O infrastructure to be, but for now, I think it is
> unreasonable to ask Andreas to wait for all this.
> 
> - Danilo

Fine, let’s stick to VecDeque then. From what I am reading above, there
doesn’t seem to be any naks for a more general ring buffer type due to the
current patch; it’s just not a good time yet. In which case, there’s no
complaints from me.

— Daniel



  reply	other threads:[~2026-02-16 14:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-15 20:24 Andreas Hindborg
2026-02-16  4:35 ` Daniel Almeida
2026-02-16  7:11   ` Andreas Hindborg
2026-02-16 11:44     ` Daniel Almeida
2026-02-16 12:25 ` Alice Ryhl
2026-02-16 12:43   ` Daniel Almeida
2026-02-16 13:27   ` Andreas Hindborg
2026-02-16 13:45     ` Daniel Almeida
2026-02-16 14:06       ` Danilo Krummrich
2026-02-16 14:21         ` Daniel Almeida
2026-02-16 14:39           ` Danilo Krummrich
2026-02-16 14:46             ` Daniel Almeida [this message]
2026-02-17 10:02               ` Andreas Hindborg
2026-02-17 14:26                 ` Danilo Krummrich
2026-02-17 19:10                   ` Andreas Hindborg
2026-02-17 19:25                     ` Daniel Almeida
2026-02-18  8:29                     ` Alice Ryhl

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=71F89D79-DBE1-4617-B58A-8552D0F2B3A2@collabora.com \
    --to=daniel.almeida@collabora.com \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /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®