[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aHEdAPFNId2bgoKu@Mac.home>
Date: Fri, 11 Jul 2025 07:17:36 -0700
From: Boqun Feng <boqun.feng@...il.com>
To: Danilo Krummrich <dakr@...nel.org>
Cc: Alice Ryhl <aliceryhl@...gle.com>, Tejun Heo <tj@...nel.org>,
Miguel Ojeda <ojeda@...nel.org>,
Lai Jiangshan <jiangshanlai@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Andreas Hindborg <a.hindborg@...nel.org>,
Trevor Gross <tmgross@...ch.edu>,
Daniel Almeida <daniel.almeida@...labora.com>,
Tamir Duberstein <tamird@...il.com>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org, Benno Lossin <lossin@...nel.org>,
Hamza Mahfooz <hamzamahfooz@...ux.microsoft.com>
Subject: Re: [PATCH v3] workqueue: rust: add delayed work items
[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.
Powered by blists - more mailing lists