rust: workqueue: replace deprecated system_wq with system_{percpu,dfl}_wq
Subsystems (6)
Alice Ryhl
maintainerPATCH v2 1/1 rust: workqueue: replace deprecated system_wq with system_{percpu,dfl}_wq
From: Danilo Krummrich <[email protected]>
system_wq is deprecated and triggers a runtime warning:
[ 0.857414] workqueue: work func ...WorkItemPointerKy0_E3runB7_ enqueued on deprecated workqueue. Use system_{percpu|dfl}_wq instead.Replace system() with system_percpu() and system_dfl(), to match the previous behavior of the deprecated system() and convert doc examples and tests to system_dfl().
system_unbound_wq is deprecated in the same way, in favor of system_dfl_wq. Since system_unbound() has no users, just remove it as well.
---
This patch was previously sent as part of other workqueue series [1][2]. However it's a fix that is independent of those series, so it's sent on its own here.
[1] https://lore.kernel.org/all/[email protected]
[2] https://lore.kernel.org/all/[email protected]
---
Changes in v2:
- Also remove system_unbound(), which is deprecated in the same way
and has no users. (Gary)
- Collect Reviewed-by from Boqun and Dongliang.
- Link to v1: https://lore.kernel.org/r/[email protected]
Changes since [2]:
- Rebase on v7.3-rc7 and also convert the new SpinLockIrq KUnit test, which calls workqueue::system() and otherwise fails to build.
- Add Fixes: tag for the commit that made system_wq warn.
- Collect Reviewed-by from Daniel.
--- Documentation/rust/testing.rst | 2 +- Documentation/translations/zh_CN/rust/testing.rst | 2 +- drivers/android/binder/process.rs | 4 +- rust/kernel/sync/completion.rs | 2 +- rust/kernel/sync/lock/spinlock.rs | 2 +- rust/kernel/workqueue.rs | 52 ++++++++++++----------- 6 files changed, 33 insertions(+), 31 deletions(-)
Documentation/rust/testing.rst +1 -1
@@ -97,7 +97,7 @@ operator are also supported as usual, e.g.: /// ``` /// # use kernel::{spawn_work_item, workqueue}; - /// spawn_work_item!(workqueue::system(), || pr_info!("x\n"))?; + /// spawn_work_item!(workqueue::system_dfl(), || pr_info!("x\n"))?; /// # Ok::<(), Error>(()) /// ```
Documentation/translations/zh_CN/rust/testing.rst +1 -1
@@ -93,7 +93,7 @@ KUnit 测试即文档测试 /// ``` /// # use kernel::{spawn_work_item, workqueue}; - /// spawn_work_item!(workqueue::system(), || pr_info!("x\n"))?; + /// spawn_work_item!(workqueue::system_dfl(), || pr_info!("x\n"))?; /// # Ok::<(), Error>(()) /// ```
drivers/android/binder/process.rs +2 -2
@@ -1728,7 +1728,7 @@ pub(crate) fn release(this: Arc<Process>, _file: &File) {if should_schedule {// Ignore failures to schedule to the workqueue. Those just mean that we're already // scheduled for execution. -let _ = workqueue::system ().enqueue (this); +let _ = workqueue::system_percpu ().enqueue (this); }drop (binderfs_file);
@@ -1745,7 +1745,7 @@ pub(crate) fn flush(this: ArcBorrow<'_, Process>) -> Result {if should_schedule {// Ignore failures to schedule to the workqueue. Those just mean that we're already // scheduled for execution. -let _ = workqueue::system ().enqueue (Arc ::from (this)); +let _ = workqueue::system_percpu ().enqueue (Arc ::from (this)); }Ok (()) }
rust/kernel/sync/completion.rs +1 -1
@@ -38,7 +38,7 @@/// done <- Completion::new(), /// }), GFP_KERNEL)?; /// -/// let _ = workqueue::system().enqueue(this.clone()); +/// let _ = workqueue::system_dfl().enqueue(this.clone()); /// /// Ok(this) /// }
rust/kernel/sync/lock/spinlock.rs +1 -1
@@ -450,7 +450,7 @@ fn run(this: Arc<Self>) {fn spinlock_irq_condvar () ->Result {let testdata =Test ::new ()?; -let _ = workqueue::system ().enqueue (testdata.clone ()); +let _ = workqueue::system_dfl ().enqueue (testdata.clone ());// Let the updater know when we're ready to wait let mut state = testdata.state.lock ();
rust/kernel/workqueue.rs +27 -25
118 lines not on this page · raw message
---
base-commit: 24a19b953e2a3d0ea5a8c4951a0ab8f32720c907
change-id: 20261013-rust-workqueue-system-fix-5f9020c90f27
Best regards,
Signature · 1 line
Alice Ryhl <[email protected]>
Quoted 14 lines · Alice Ryhl
From: Danilo Krummrich <[email protected]>
system_wqis deprecated and triggers a runtime warning:[ 0.857414] workqueue: work func ...WorkItemPointerKy0_E3runB7_ enqueued on deprecated workqueue. Use system_{percpu|dfl}_wq instead.Replace
system()withsystem_percpu()andsystem_dfl(), to match the previous behavior of the deprecatedsystem()and convert doc examples and tests tosystem_dfl().
system_unbound_wqis deprecated in the same way, in favor ofsystem_dfl_wq. Sincesystem_unbound()has no users, just remove it as well.
Quoted 6 lines
Fixes 64d8eae3f895 ("workqueue: Add warnings and fallback if system_{unbound}_wq is used")Signed-off-by Danilo Krummrich <[email protected]>Reviewed-by Daniel Almeida <[email protected]>Reviewed-by Boqun Feng <[email protected]>Reviewed-by Dongliang Mu <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Quoted 27 lines
---
This patch was previously sent as part of other workqueue series [1][2]. However it's a fix that is independent of those series, so it's sent on its own here.[1] https://lore.kernel.org/all/[email protected]
[2] https://lore.kernel.org/all/[email protected]
---
Changes in v2:
- Also removesystem_unbound(), which is deprecated in the same way
and has no users. (Gary)
- Collect Reviewed-by from Boqun and Dongliang.
- Link to v1: https://lore.kernel.org/r/[email protected]Changes since [2]:
- Rebase on v7.3-rc7 and also convert the new SpinLockIrq KUnit test, which callsworkqueue::system()and otherwise fails to build.
- Add Fixes: tag for the commit that madesystem_wqwarn.
- Collect Reviewed-by from Daniel.--- Documentation/rust/testing.rst | 2 +- Documentation/translations/zh_CN/rust/testing.rst | 2 +- drivers/android/binder/process.rs | 4 +- rust/kernel/sync/completion.rs | 2 +- rust/kernel/sync/lock/spinlock.rs | 2 +- rust/kernel/workqueue.rs | 52 ++++++++++++----------- 6 files changed, 33 insertions(+), 31 deletions(-)
Quoted 15 lines · Alice Ryhl
From: Danilo Krummrich <[email protected]>
system_wqis deprecated and triggers a runtime warning:[ 0.857414] workqueue: work func ...WorkItemPointerKy0_E3runB7_ enqueued on deprecated workqueue. Use system_{percpu|dfl}_wq instead.Replace
system()withsystem_percpu()andsystem_dfl(), to match the previous behavior of the deprecatedsystem()and convert doc examples and tests tosystem_dfl().
system_unbound_wqis deprecated in the same way, in favor ofsystem_dfl_wq. Sincesystem_unbound()has no users, just remove it as well.
Quoted 6 lines
Fixes 64d8eae3f895 ("workqueue: Add warnings and fallback if system_{unbound}_wq is used")Signed-off-by Danilo Krummrich <[email protected]>Reviewed-by Daniel Almeida <[email protected]>Reviewed-by Boqun Feng <[email protected]>Reviewed-by Dongliang Mu <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Happy to pick it up if workqueue is OK with it.
Cheers,
Miguel
Quoted 15 lines · Alice Ryhl
From: Danilo Krummrich <[email protected]>
system_wqis deprecated and triggers a runtime warning:[ 0.857414] workqueue: work func ...WorkItemPointerKy0_E3runB7_ enqueued on deprecated workqueue. Use system_{percpu|dfl}_wq instead.Replace
system()withsystem_percpu()andsystem_dfl(), to match the previous behavior of the deprecatedsystem()and convert doc examples and tests tosystem_dfl().
system_unbound_wqis deprecated in the same way, in favor ofsystem_dfl_wq. Sincesystem_unbound()has no users, just remove it as well.
Quoted 6 lines
Fixes 64d8eae3f895 ("workqueue: Add warnings and fallback if system_{unbound}_wq is used")Signed-off-by Danilo Krummrich <[email protected]>Reviewed-by Daniel Almeida <[email protected]>Reviewed-by Boqun Feng <[email protected]>Reviewed-by Dongliang Mu <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Thanks!
Signature · 3 lines
Marco Crivellari SUSE Labs
Quoted 14 lines · Alice Ryhl
From: Danilo Krummrich <[email protected]>
system_wqis deprecated and triggers a runtime warning:[ 0.857414] workqueue: work func ...WorkItemPointerKy0_E3runB7_ enqueued on deprecated workqueue. Use system_{percpu|dfl}_wq instead.Replace
system()withsystem_percpu()andsystem_dfl(), to match the previous behavior of the deprecatedsystem()and convert doc examples and tests tosystem_dfl().
system_unbound_wqis deprecated in the same way, in favor ofsystem_dfl_wq. Sincesystem_unbound()has no users, just remove it as well.
Quoted 6 lines
Fixes 64d8eae3f895 ("workqueue: Add warnings and fallback if system_{unbound}_wq is used")Signed-off-by Danilo Krummrich <[email protected]>Reviewed-by Daniel Almeida <[email protected]>Reviewed-by Boqun Feng <[email protected]>Reviewed-by Dongliang Mu <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Thanks.
--
tejun
Miguel Ojeda
AppliedQuoted 15 lines · Alice Ryhl
From: Danilo Krummrich <[email protected]>
system_wqis deprecated and triggers a runtime warning:[ 0.857414] workqueue: work func ...WorkItemPointerKy0_E3runB7_ enqueued on deprecated workqueue. Use system_{percpu|dfl}_wq instead.Replace
system()withsystem_percpu()andsystem_dfl(), to match the previous behavior of the deprecatedsystem()and convert doc examples and tests tosystem_dfl().
system_unbound_wqis deprecated in the same way, in favor ofsystem_dfl_wq. Sincesystem_unbound()has no users, just remove it as well.
Quoted 6 lines
Fixes 64d8eae3f895 ("workqueue: Add warnings and fallback if system_{unbound}_wq is used")Signed-off-by Danilo Krummrich <[email protected]>Reviewed-by Daniel Almeida <[email protected]>Reviewed-by Boqun Feng <[email protected]>Reviewed-by Dongliang Mu <[email protected]>Signed-off-by Alice Ryhl <[email protected]>
Applied to rust-fixes -- thanks everyone!
Cheers,
Miguel