From: Boqun Feng <boqun.feng@gmail.com>
To: Danilo Krummrich <dakr@kernel.org>
Cc: "Alice Ryhl" <aliceryhl@google.com>, "Tejun Heo" <tj@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"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>,
"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>,
"Hamza Mahfooz" <hamzamahfooz@linux.microsoft.com>
Subject: Re: [PATCH v3] workqueue: rust: add delayed work items
Date: Fri, 11 Jul 2025 07:17:36 -0700 [thread overview]
Message-ID: <aHEdAPFNId2bgoKu@Mac.home> (raw)
In-Reply-To: <DB9A8OPZK3DZ.YVQPQQSD12MU@kernel.org>
[Cc Hamza]
On Fri, Jul 11, 2025 at 04:07:04PM +0200, Danilo Krummrich wrote:
> Hi Alice,
>
> On Fri Jul 11, 2025 at 9:59 AM CEST, Alice Ryhl wrote:
> > This patch is being sent for use in the various Rust GPU drivers that
> > are under development. It provides the additional feature of work items
> > that are executed after a delay.
>
> I thought I commented on this in a previous version already, but apparently I
> haven't (was it a different thread maybe?).
>
> For drivers, we should also support 'scoped' work items and worqueues, where
> 'scoped' means limit the lifetime to the driver being bound to a device.
>
> For better understanding, in C one would call this devm_alloc_workqueue(), which
> would guarantee that the workqueue is terminated on device unbind. Similar for
> individual work items on shared workqueues (such as the system ones), which
> would be canceled synchronously on driver unbind.
When using system workqueue, and at driver unbind time, you want to
cancel the driver works instead of flushing them (i.e. wait until they
get executed)? Canceling might be tricky (because currently we give away
the ownership of the work item), and I think Hamaz has been looking into
this as well, so add him.
But in general I agree scoped work is very useful.
Regards,
Boqun
>
> This is very useful for drivers, since it allows to provide a &Device<Bound>
> within the work's callback, which allows drivers to access device resources
> safely and directly without additional overhead.
next prev parent reply other threads:[~2025-07-11 14:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-11 7:59 [PATCH v3] workqueue: rust: add delayed work items Alice Ryhl
2025-07-11 14:07 ` Danilo Krummrich
2025-07-11 14:17 ` Boqun Feng [this message]
2025-07-14 10:45 ` Alice Ryhl
2025-07-16 22:49 ` Miguel Ojeda
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=aHEdAPFNId2bgoKu@Mac.home \
--to=boqun.feng@gmail.com \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=gary@garyguo.net \
--cc=hamzamahfooz@linux.microsoft.com \
--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.