Skip to content

workqueue: OwnedQueue, ScopedQueue and ScopedWork

Danilo Krummrich driver-core lkml rust-for-linux stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 14 repliesIn review
  2. v17 patches 5 repliesSuperseded

Changes in v2 from the cover letter

- 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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6rust: workqueue: replace deprecated system_wq with system_{percpu,dfl}_wqDocumentation/rust/testing.rst Documentation/translations/zh_CN/rust/testing.rst drivers/android/binder/process.rs +2 more+32 -201 reply
2/6rust: workqueue: restrict delayed work to global wqsrust/kernel/workqueue.rs+8 -11 reply
3/6rust: workqueue: create workqueue subdirectoryMAINTAINERS rust/kernel/workqueue/mod.rs+1 -01 reply
4/6rust: workqueue: add creation of workqueuesrust/helpers/workqueue.c rust/kernel/workqueue/builder.rs rust/kernel/workqueue/mod.rs+444 -33 replies
5/6rust: workqueue: add ScopedQueue for lifetime bound itemsrust/kernel/workqueue/mod.rs rust/kernel/workqueue/scoped.rs+193 -04 replies
6/6rust: workqueue: add ScopedWork for non-'static work itemsrust/kernel/workqueue/mod.rs rust/kernel/workqueue/scoped.rs+444 -444 replies

Reviews trailers per patch

5 of 6 patches have a Reviewed-by or Acked-by.

PatchJohn HubbardDanilo KrummrichGary GuoAndreas HindborgDaniel Almeida
1/6R-b
2/6R-b R-b R-b R-b R-b
3/6R-b
4/6R-b R-b
5/6R-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/6] workqueue: OwnedQueue, ScopedQueue and ScopedWork

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/[email protected]
[2] https://lore.kernel.org/all/[email protected]
[3] https://lore.kernel.org/all/[email protected]

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

Signature · 1 line
2.55.0