From: Alice Ryhl <aliceryhl@google.com>
To: Boqun Feng <boqun.feng@gmail.com>
Cc: "Tejun Heo" <tj@kernel.org>, "Miguel Ojeda" <ojeda@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Lai Jiangshan" <jiangshanlai@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@gmail.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
"Benno Lossin" <lossin@kernel.org>
Subject: Re: [PATCH v2] workqueue: rust: add delayed work items
Date: Thu, 10 Jul 2025 13:10:59 +0000 [thread overview]
Message-ID: <aG-7402hh4CCN7vh@google.com> (raw)
In-Reply-To: <aF7YWE4bz98Gqh1y@tardis.local>
On Fri, Jun 27, 2025 at 10:43:52AM -0700, Boqun Feng wrote:
> On Fri, Jun 27, 2025 at 09:38:42AM +0000, Alice Ryhl wrote:
> [...]
> > + /// Get a pointer to the inner `delayed_work`.
> > + ///
> > + /// # Safety
> > + ///
> > + /// The provided pointer must not be dangling and must be properly aligned. (But the memory
> > + /// need not be initialized.)
> > + #[inline]
> > + pub unsafe fn raw_as_work(ptr: *const Self) -> *mut Work<T, ID> {
> > + // SAFETY: The caller promises that the pointer is aligned and not dangling.
> > + let dw: *mut bindings::delayed_work =
> > + unsafe { Opaque::raw_get(core::ptr::addr_of!((*ptr).dwork)) };
>
> This would conflict with your Opaque::cast_into() series ;-) So I
> suggest that we rebase this one onto:
>
> https://lore.kernel.org/rust-for-linux/20250624-opaque-from-raw-v2-0-e4da40bdc59c@google.com/
>
> and send them together. But it's up to you and maintainers, and even we
> do that let's wait for some reviews on this patch to save extra
> versions.
Will rebase.
> I'm going to review it, just figure this better be pointed out.
>
> Btw, as a review comment, I believe we are in favor of `&raw mut` now,
> so this should be:
>
>
> unsafe { Opaque::cast_from(&raw const (*ptr).dwork) };
>
> > + // SAFETY: The caller promises that the pointer is aligned and not dangling.
> > + let wrk: *mut bindings::work_struct = unsafe { core::ptr::addr_of_mut!((*dw).work) };
>
> Ditto.
The rest of the file still uses addr_of!. I think we should stay
consistent. We can update the entire file in one go.
Alice
next prev parent reply other threads:[~2025-07-10 13:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-27 9:38 [PATCH v2] workqueue: rust: add delayed work items Alice Ryhl
2025-06-27 16:55 ` Tejun Heo
2025-06-27 17:43 ` Boqun Feng
2025-07-10 13:10 ` Alice Ryhl [this message]
2025-07-10 16:30 ` Boqun Feng
2025-06-27 18:39 ` Boqun Feng
2025-07-10 13:12 ` 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=aG-7402hh4CCN7vh@google.com \
--to=aliceryhl@google.com \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=gary@garyguo.net \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@gmail.com \
--cc=tj@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.