[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <03003f10-00c0-44dd-b9df-5763cc1e715f@nvidia.com>
Date: Wed, 26 Nov 2025 12:57:22 -0800
From: John Hubbard <jhubbard@...dia.com>
To: Joel Fernandes <joelagnelf@...dia.com>,
Alexandre Courbot <acourbot@...dia.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"rust-for-linux@...r.kernel.org" <rust-for-linux@...r.kernel.org>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"dakr@...nel.org" <dakr@...nel.org>, "airlied@...il.com"
<airlied@...il.com>, Alistair Popple <apopple@...dia.com>,
"ojeda@...nel.org" <ojeda@...nel.org>,
"alex.gaynor@...il.com" <alex.gaynor@...il.com>,
"boqun.feng@...il.com" <boqun.feng@...il.com>,
"gary@...yguo.net" <gary@...yguo.net>,
"bjorn3_gh@...tonmail.com" <bjorn3_gh@...tonmail.com>,
"lossin@...nel.org" <lossin@...nel.org>,
"a.hindborg@...nel.org" <a.hindborg@...nel.org>,
"aliceryhl@...gle.com" <aliceryhl@...gle.com>,
"tmgross@...ch.edu" <tmgross@...ch.edu>, "simona@...ll.ch"
<simona@...ll.ch>,
"maarten.lankhorst@...ux.intel.com" <maarten.lankhorst@...ux.intel.com>,
"mripard@...nel.org" <mripard@...nel.org>,
"tzimmermann@...e.de" <tzimmermann@...e.de>, Timur Tabi <ttabi@...dia.com>,
"joel@...lfernandes.org" <joel@...lfernandes.org>,
"elle@...thered-steel.dev" <elle@...thered-steel.dev>,
"daniel.almeida@...labora.com" <daniel.almeida@...labora.com>,
Andrea Righi <arighi@...dia.com>, "phasta@...nel.org" <phasta@...nel.org>,
"nouveau@...ts.freedesktop.org" <nouveau@...ts.freedesktop.org>,
Nouveau <nouveau-bounces@...ts.freedesktop.org>
Subject: Re: [PATCH v2 1/3] rust: helpers: Add list helpers for C linked list
operations
On 11/26/25 10:50 AM, Joel Fernandes wrote:
>> On Nov 25, 2025, at 8:16 PM, Alexandre Courbot <acourbot@...dia.com> wrote:
>> On Wed Nov 26, 2025 at 3:16 AM JST, Joel Fernandes wrote:
>>>>> On Nov 25, 2025, at 9:52 AM, Alexandre Courbot <acourbot@...dia.com> wrote:
>>>> On Wed Nov 12, 2025 at 2:13 AM JST, Joel Fernandes wrote:
...
> You do have a point that we have an abstraction leak anyway, so the question is do we need helpers at all.
>
I'm writing this in order to suggest a stance in this area, for future
feature tradeoffs. If this is somehow "off", I'll upgrade my thinking,
but at the moment I'm very comfortable making the following claims:
> I am torn on this. On the one hand, if someone changes how list_head api works, then the rust side breaks
OK, this is not going to happen, at list not without a truly epic, long-term
effort, accompanied by *lots* of publicity. The list_head API is just too
foundational to change easily.
It's been stable since *at least* 2006. The only change since then has been
to add WRITE_ONCE() wrappers to the INIT_LIST_HEAD implementation--and that
is not an API change.
Anything is possible, but this is sufficiently far out there that it should
not count for much here.
(though that is easy to flag though via doc tests). On the other hand, we have the function call overhead you pointed and we are dealing with the pointers in rust directly anyway in some cases.
Whereas this is very significant! We really, really do not want to accept
a performance loss vs. C, without an excellent justification.
So I think you've made the right decision. The above is just to help
solidify the reasons why.
thanks,
--
John Hubbard
Powered by blists - more mailing lists