|
|
Log in / Subscribe / Register

rust-helpers: add workqueue helpers

From:  Aakash Bollineni via B4 Relay <devnull+aakash.bollineni.multicorewareinc.com-AT-kernel.org>
To:  Miguel Ojeda <ojeda-AT-kernel.org>, Boqun Feng <boqun-AT-kernel.org>, Gary Guo <gary-AT-garyguo.net>, Björn Roy Baron <bjorn3_gh-AT-protonmail.com>, Benno Lossin <lossin-AT-kernel.org>, Andreas Hindborg <a.hindborg-AT-kernel.org>, Alice Ryhl <aliceryhl-AT-google.com>, Trevor Gross <tmgross-AT-umich.edu>, Danilo Krummrich <dakr-AT-kernel.org>
Subject:  [PATCH v7 0/3] rust-helpers: add workqueue helpers
Date:  Thu, 21 May 2026 14:24:20 +0530
Message-ID:  <20260521-workqueue-v5-sent-v7-0-fb4b4dde35ec@multicorewareinc.com>
Cc:  rust-for-linux-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org, Aakash Bollineni <aakash.bollineni-AT-multicorewareinc.com>
Archive-link:  Article

Changes in v7:
- Fixed KUnit and rustfmtcheck errors reported by the 0-DAY CI Kernel Test Robot by correctly restoring the `arc_count` function and removing orphaned `#[cfg]` attributes.
- Added an explicit `depends on KUNIT` to `CONFIG_SAMPLE_RUST_WORKQUEUE` in `samples/rust/Kconfig` to prevent randconfig build failures when the sample is enabled but KUnit is disabled.
- Fixed an E0277 trait bounds compilation error for `TestDelayedWorkItem` by utilizing the `impl_has_delayed_work!` macro instead of a manual unsafe implementation.
- Link to v6: https://lore.kernel.org/r/20260408-workqueue-v5-sent-v6-0...

rust: workqueue: add safe cancellation and status methods

Changes in v6:
- Refactored rust_helper_init_delayed_work to ensure robust, single-pass initialization
  using standard kernel macros, avoiding redundant lockdep and timer setup.
- Simplified impl_has_delayed_work! macro by using direct pointer casting for
  work_container_of.
- Added missing # Safety documentation blocks to reclaim methods for Arc and KBox.
- Improved documentation readability by adding vertical whitespace to all examples.
- Cleaned up link syntax by using direct inline links and removing redundant reference lists.
- Removed unused rust_helper_get_dwork_timer_fn C helper.
- Link to v5: https://lore.kernel.org/r/20260407-workqueue-v5-sent-v1-0...

---
Aakash Bollineni (3):
      rust: helpers: add workqueue helpers
      rust: workqueue: add safe cancellation and status methods
      rust: workqueue: add KUnit and sample stress tests

 rust/helpers/workqueue.c            |  27 ++
 rust/kernel/workqueue.rs            | 500 +++++++++++++++++++++++++++++++++---
 samples/rust/Kconfig                |  11 +
 samples/rust/Makefile               |   2 +
 samples/rust/rust_workqueue_test.rs | 191 ++++++++++++++
 5 files changed, 696 insertions(+), 35 deletions(-)
---
base-commit: bf074eb6891be799174ff42e0051492681fdc045
change-id: 20260407-workqueue-v5-sent-a895d51cc4f5

Best regards,
-- 
Aakash Bollineni <aakash.bollineni@multicorewareinc.com>





Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds