[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250529143634.GD192517@ziepe.ca>
Date: Thu, 29 May 2025 11:36:34 -0300
From: Jason Gunthorpe <jgg@...pe.ca>
To: Petr Tesařík <petr@...arici.cz>
Cc: Abdiel Janulgue <abdiel.janulgue@...il.com>, acourbot@...dia.com,
dakr@...nel.org, lyude@...hat.com, Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Valentin Obst <kernel@...entinobst.de>,
open list <linux-kernel@...r.kernel.org>,
Marek Szyprowski <m.szyprowski@...sung.com>,
Robin Murphy <robin.murphy@....com>, airlied@...hat.com,
rust-for-linux@...r.kernel.org,
"open list:DMA MAPPING HELPERS" <iommu@...ts.linux.dev>,
Andrew Morton <akpm@...ux-foundation.org>,
Herbert Xu <herbert@...dor.apana.org.au>,
Sui Jingfeng <sui.jingfeng@...ux.dev>,
Randy Dunlap <rdunlap@...radead.org>,
Michael Kelley <mhklinux@...look.com>
Subject: Re: [PATCH 1/2] rust: add initial scatterlist bindings
On Thu, May 29, 2025 at 04:14:24PM +0200, Petr Tesařík wrote:
> Thank you, Jason. You already made this suggestion for the RFC version,
> and it begs the question if perhaps the underlying C API should also be
> deprecated and eventually removed from the kernel.
It is not "broken", it is just complicated to use right and doesn't
fit the sematics rust would expect.
Yes, it would be nice if more places used sgtable and append instead
but there are so many places and many weird special cases.
scatterlist is so widely used and in so many bonkers ways it is felt
to be unchangable.
My advice is that rust should not just have a thin wrapper around
scatterlist but actually provide a sane correct higher level API and
wall off more of the difficult choices (like set_page)
Arguably Rust shouldn't have scatterlist at all, but only sgtable
which is the higher level and easier to use interface.
We also just merged a non-scatterlist DMA mapping API, maybe rust
shouldn't have scatterlist at all. IDK.
Jason
Powered by blists - more mailing lists