The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH v2 0/6] workqueue: OwnedQueue, ScopedQueue and ScopedWork
@ 2026-08-07 16:52 Danilo Krummrich
  2026-08-07 16:52 ` [PATCH v2 1/6] rust: workqueue: replace deprecated system_wq with system_{percpu,dfl}_wq Danilo Krummrich
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Danilo Krummrich @ 2026-08-07 16:52 UTC (permalink / raw)
  To: tj, jiangshanlai, aliceryhl, ojeda, boqun, gary, bjorn3_gh,
	lossin, a.hindborg, tmgross, daniel.almeida, tamird, acourbot,
	work, jhubbard
  Cc: rust-for-linux, linux-kernel, driver-core, Danilo Krummrich

This series extends the Rust workqueue bindings with the ability to create
custom workqueues, enqueue non-'static work items on scoped queues, and
introduces ScopedWork, a work item type that cancels synchronously on drop,
allowing drivers to use workqueues with lifetime-bound data.

This picks up and extends prior work from Alice [1] and Onur [2]; changes I
subsequently applied, if any, are documented in the corresponding patch.

I also added a patch to replace the deprecated system_wq with
system_{percpu,dfl}_wq, which I originally sent with the WaitQueue series [3],
as it makes a bit more sense in this context.

[1] https://lore.kernel.org/all/20260312-create-workqueue-v4-0-ea39c351c38f@google.com
[2] https://lore.kernel.org/all/20260617144645.253444-1-work@onurozkan.dev
[3] https://lore.kernel.org/all/20260726223613.1242940-3-dakr@kernel.org

Changes in v2:
  - Merge scoped_work.rs and scoped_queue.rs into scoped.rs
  - Introduce ScopedWorkRef<T> and wrap it in Opaque inside ScopedWork to avoid
    &mut aliasing in drop
  - Pass &ScopedWorkRef<Self> to ScopedWorkItem::run to enable self-re-enqueue
  - Add Deref<Target = Queue> for ScopedQueue; remove duplicate enqueue_scoped()
  - Add Send + Sync for OwnedQueue
  - Fix stale workqueue::system() references in docs
  - Drop Work::cancel_work_sync()
  - Make sysfs() available on ordered workqueues
  - Add #[inline] annotations throughout

Alice Ryhl (3):
  rust: workqueue: restrict delayed work to global wqs
  rust: workqueue: create workqueue subdirectory
  rust: workqueue: add creation of workqueues

Danilo Krummrich (2):
  rust: workqueue: replace deprecated system_wq with
    system_{percpu,dfl}_wq
  rust: workqueue: add ScopedWork for non-'static work items

Onur Özkan (1):
  rust: workqueue: add ScopedQueue for lifetime bound items

 Documentation/rust/testing.rst                |   2 +-
 .../translations/zh_CN/rust/testing.rst       |   2 +-
 MAINTAINERS                                   |   1 +
 drivers/android/binder/process.rs             |   4 +-
 rust/helpers/workqueue.c                      |   7 +
 rust/kernel/sync/completion.rs                |   2 +-
 rust/kernel/workqueue/builder.rs              | 389 ++++++++++++
 .../kernel/{workqueue.rs => workqueue/mod.rs} | 149 ++++-
 rust/kernel/workqueue/scoped.rs               | 568 ++++++++++++++++++
 9 files changed, 1089 insertions(+), 35 deletions(-)
 create mode 100644 rust/kernel/workqueue/builder.rs
 rename rust/kernel/{workqueue.rs => workqueue/mod.rs} (90%)
 create mode 100644 rust/kernel/workqueue/scoped.rs


base-commit: b48373c901951fad1a26bd7c33ad91172b3945b5
-- 
2.55.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-08-07 22:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07 16:52 [PATCH v2 0/6] workqueue: OwnedQueue, ScopedQueue and ScopedWork Danilo Krummrich
2026-08-07 16:52 ` [PATCH v2 1/6] rust: workqueue: replace deprecated system_wq with system_{percpu,dfl}_wq Danilo Krummrich
2026-08-07 16:52 ` [PATCH v2 2/6] rust: workqueue: restrict delayed work to global wqs Danilo Krummrich
2026-08-07 16:52 ` [PATCH v2 3/6] rust: workqueue: create workqueue subdirectory Danilo Krummrich
2026-08-07 16:52 ` [PATCH v2 4/6] rust: workqueue: add creation of workqueues Danilo Krummrich
2026-08-07 22:39   ` Danilo Krummrich
2026-08-07 16:52 ` [PATCH v2 5/6] rust: workqueue: add ScopedQueue for lifetime bound items Danilo Krummrich
2026-08-07 16:52 ` [PATCH v2 6/6] rust: workqueue: add ScopedWork for non-'static work items Danilo Krummrich
2026-08-07 18:35   ` Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox