mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: Joel Fernandes <joelagnelf@nvidia.com>,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org,
	Danilo Krummrich <dakr@kernel.org>,
	Dave Airlie <airlied@gmail.com>
Cc: Alexandre Courbot <acourbot@nvidia.com>,
	Alistair Popple <apopple@nvidia.com>,
	Miguel Ojeda <ojeda@kernel.org>,
	Alex Gaynor <alex.gaynor@gmail.com>,
	Boqun Feng <boqun.feng@gmail.com>, Gary Guo <gary@garyguo.net>,
	bjorn3_gh@protonmail.com, Benno Lossin <lossin@kernel.org>,
	Andreas Hindborg <a.hindborg@kernel.org>,
	Alice Ryhl <aliceryhl@google.com>,
	Trevor Gross <tmgross@umich.edu>, Simona Vetter <simona@ffwll.ch>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Timur Tabi <ttabi@nvidia.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	Lyude Paul <elle@weathered-steel.dev>,
	Daniel Almeida <daniel.almeida@collabora.com>,
	Andrea Righi <arighi@nvidia.com>,
	Philipp Stanner <phasta@kernel.org>
Subject: Re: [PATCH v3] rust: clist: Add support to interface with C linked lists
Date: Mon, 1 Dec 2025 14:52:34 -0800	[thread overview]
Message-ID: <4224983e-7788-4c40-8046-a67e67c9d052@nvidia.com> (raw)
In-Reply-To: <2700c827-d3af-403c-857a-30324e0d8502@nvidia.com>

On 12/1/25 2:43 PM, Joel Fernandes wrote:
> On 12/1/2025 5:17 PM, John Hubbard wrote:
>> On 12/1/25 12:32 PM, Joel Fernandes wrote:
>>> On 11/30/2025 7:34 PM, John Hubbard wrote:
>>>> On 11/29/25 1:30 PM, Joel Fernandes wrote:
>> ...
> You may want to read [1]. CONFIG_RUST_KERNEL_DOCTESTS are run at runtime. You
> enable it and boot the kernel. The documentation clearly says "doctests get
> compiled as Rust kernel objects, allowing them to run against a built kernel.".
> And this is how I have run it as well.
> 
> [1] https://docs.kernel.org/rust/testing.html
> 
> This also explains why you think list_add_tail() is a noop in my patch, which it
> is not.

Yes, I forgot that they are actually run, you are right.

> 
>>
>> I would humbly suggest that you build and *run* your own samples code, for
>> new code that has no users yet.
> 
> Yes, I already have an internal tree running it. :) I am not sure why the
> assume_init() triggered for you but not for me, I don't think has anything to do
> with doctests since the doctests is in fact just rust code compiled as KUNIT tests.

I think it's because I wrote separate code that was not a doctest, and
that code is naturally different from however the doctest exercised it.
But it is a good question.

> 
>> Because if you are skipping steps like this (posting the code before
>> there is an actual caller), then the documentation of how to use it
>> is not "just documentation" anymore--it really needs to run correctly.
> 
> No, that's the thing, these are run. You really are in the wrong here and appear
> to not understand how doctests work.

That's a reasonable statement. :)

> 
>> And actually, after writing the above...I still think it would be better
>> to post this with its first caller (DRM_BUDDY, or BUDDY_DRM_ALUMNI, or
>> however it ends up), so that we can see how it looks and behaves in
>> practice.
>>
>> What's the rush?
> 
> Who said anything about a rush? I am really confused by what you mean. It is
> useful to post patches even if there are external dependencies to get feedback.
> So this is also an invalid review comment unfortunately. There is no rush, this
> is v3 now, did you miss that?
> 

I mean, doctests are far weaker than actual code that uses the new API.
It feels rushed to propose merging code without a caller. And I don't
think doctests are a "real enough" caller.

thanks,
-- 
John Hubbard


  reply	other threads:[~2025-12-01 22:52 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-29 21:30 Joel Fernandes
2025-12-01  0:34 ` John Hubbard
2025-12-01 20:32   ` Joel Fernandes
2025-12-01 20:57     ` Joel Fernandes
2025-12-01 22:17     ` John Hubbard
2025-12-01 22:43       ` Joel Fernandes
2025-12-01 22:52         ` John Hubbard [this message]
2025-12-01 23:09           ` Joel Fernandes
2025-12-01 23:15             ` John Hubbard
2025-12-01 23:21               ` Joel Fernandes
2025-12-01 22:58         ` Miguel Ojeda
2025-12-01 22:50       ` Miguel Ojeda
2025-12-01 22:54         ` John Hubbard
2025-12-01 15:25 ` Alice Ryhl
2025-12-01 21:35   ` Joel Fernandes
2025-12-01 16:51 ` Daniel Almeida
2025-12-01 19:35   ` John Hubbard
2025-12-01 20:06     ` Joel Fernandes
2025-12-01 23:01       ` Daniel Almeida
2025-12-01 23:23         ` Joel Fernandes
2025-12-01 22:54     ` Daniel Almeida
2025-12-01 22:58       ` Miguel Ojeda
2025-12-01 21:46   ` Joel Fernandes
2025-12-03 13:06 ` Alexandre Courbot
2025-12-03 15:08   ` Joel Fernandes

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=4224983e-7788-4c40-8046-a67e67c9d052@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@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

all inboxes | Powered by JetHome®