From: John Hubbard <jhubbard@nvidia.com>
To: Joel Fernandes <joelagnelf@nvidia.com>,
Alexandre Courbot <acourbot@nvidia.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"rust-for-linux@vger.kernel.org" <rust-for-linux@vger.kernel.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"dakr@kernel.org" <dakr@kernel.org>,
"airlied@gmail.com" <airlied@gmail.com>,
Alistair Popple <apopple@nvidia.com>,
"ojeda@kernel.org" <ojeda@kernel.org>,
"alex.gaynor@gmail.com" <alex.gaynor@gmail.com>,
"boqun.feng@gmail.com" <boqun.feng@gmail.com>,
"gary@garyguo.net" <gary@garyguo.net>,
"bjorn3_gh@protonmail.com" <bjorn3_gh@protonmail.com>,
"lossin@kernel.org" <lossin@kernel.org>,
"a.hindborg@kernel.org" <a.hindborg@kernel.org>,
"aliceryhl@google.com" <aliceryhl@google.com>,
"tmgross@umich.edu" <tmgross@umich.edu>,
"simona@ffwll.ch" <simona@ffwll.ch>,
"maarten.lankhorst@linux.intel.com"
<maarten.lankhorst@linux.intel.com>,
"mripard@kernel.org" <mripard@kernel.org>,
"tzimmermann@suse.de" <tzimmermann@suse.de>,
Timur Tabi <ttabi@nvidia.com>,
"joel@joelfernandes.org" <joel@joelfernandes.org>,
"elle@weathered-steel.dev" <elle@weathered-steel.dev>,
"daniel.almeida@collabora.com" <daniel.almeida@collabora.com>,
Andrea Righi <arighi@nvidia.com>,
"phasta@kernel.org" <phasta@kernel.org>,
"nouveau@lists.freedesktop.org" <nouveau@lists.freedesktop.org>,
Nouveau <nouveau-bounces@lists.freedesktop.org>
Subject: Re: [PATCH v2 1/3] rust: helpers: Add list helpers for C linked list operations
Date: Wed, 26 Nov 2025 12:57:22 -0800 [thread overview]
Message-ID: <03003f10-00c0-44dd-b9df-5763cc1e715f@nvidia.com> (raw)
In-Reply-To: <F3A7E1BB-883C-4EF4-B245-8E9DD329131F@nvidia.com>
On 11/26/25 10:50 AM, Joel Fernandes wrote:
>> On Nov 25, 2025, at 8:16 PM, Alexandre Courbot <acourbot@nvidia.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@nvidia.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
next prev parent reply other threads:[~2025-11-26 20:57 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-11 17:13 [PATCH v2 1/3] rust: helpers: Add list helpers for C linked list operations Joel Fernandes
2025-11-11 17:13 ` [PATCH v2 2/3] rust: clist: Add basic list infrastructure and head iterator Joel Fernandes
2025-11-24 3:47 ` Alexandre Courbot
2025-11-25 23:03 ` Joel Fernandes
2025-11-25 23:06 ` Joel Fernandes
2025-11-28 18:39 ` Daniel Almeida
2025-11-11 17:13 ` [PATCH v2 3/3] rust: clist: Add typed iteration with FromListHead trait Joel Fernandes
2025-11-24 7:01 ` Alexandre Courbot
2025-11-25 23:29 ` Joel Fernandes
2025-11-26 1:03 ` Alexandre Courbot
2025-11-26 20:14 ` Joel Fernandes
2025-11-27 3:43 ` Alexandre Courbot
2025-11-27 5:08 ` Joel Fernandes
2025-11-11 17:13 ` [PATCH v2 0/3] rust: Introduce support for C linked list interfacing Joel Fernandes
2025-11-11 19:54 ` Miguel Ojeda
2025-11-11 21:52 ` Joel Fernandes
2025-11-25 14:52 ` [PATCH v2 1/3] rust: helpers: Add list helpers for C linked list operations Alexandre Courbot
2025-11-25 18:16 ` Joel Fernandes
2025-11-25 19:48 ` John Hubbard
2025-11-25 22:52 ` Joel Fernandes
2025-11-26 1:16 ` Alexandre Courbot
2025-11-26 1:39 ` John Hubbard
2025-11-26 10:06 ` Miguel Ojeda
2025-11-26 18:15 ` John Hubbard
2025-11-26 18:50 ` Joel Fernandes
2025-11-26 20:57 ` John Hubbard [this message]
2025-11-27 5:10 ` Joel Fernandes
2025-11-27 13:46 ` Alexandre Courbot
2025-11-28 21:49 ` Joel Fernandes
2025-11-29 22:44 ` John Hubbard
2025-11-30 1:04 ` Joel Fernandes
2025-11-28 18:20 ` Daniel Almeida
2025-11-28 18:17 ` Daniel Almeida
2025-12-03 3:30 ` Alexandre Courbot
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=03003f10-00c0-44dd-b9df-5763cc1e715f@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=airlied@gmail.com \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=apopple@nvidia.com \
--cc=arighi@nvidia.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=elle@weathered-steel.dev \
--cc=gary@garyguo.net \
--cc=joel@joelfernandes.org \
--cc=joelagnelf@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=nouveau-bounces@lists.freedesktop.org \
--cc=nouveau@lists.freedesktop.org \
--cc=ojeda@kernel.org \
--cc=phasta@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tmgross@umich.edu \
--cc=ttabi@nvidia.com \
--cc=tzimmermann@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).