diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2025-03-24 16:46:03 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2025-03-24 16:46:03 -0700 |
commit | b05f8fbe0f6886f7625f5565ece53261cf65738e (patch) | |
tree | bc419d90346fb41fd819a420127c472eefaf8e29 | |
parent | 05b00ffd7a0bf31f45b63242f30b3a8a0008fa78 (diff) | |
parent | 769a72d0bf80892581366082124e9d15b2dd6b08 (diff) | |
download | linux-stable-b05f8fbe0f6886f7625f5565ece53261cf65738e.tar.gz linux-stable-b05f8fbe0f6886f7625f5565ece53261cf65738e.tar.bz2 linux-stable-b05f8fbe0f6886f7625f5565ece53261cf65738e.zip |
Merge tag 'wq-for-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq
Pull workqueue update from Tejun Heo:
"Just one commit to expose system BH workqueues to rust"
* tag 'wq-for-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
rust: workqueue: define built-in bh queues
-rw-r--r-- | rust/kernel/workqueue.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs index b7be224cdf4b..4cf9a5a9b6c3 100644 --- a/rust/kernel/workqueue.rs +++ b/rust/kernel/workqueue.rs @@ -703,3 +703,21 @@ pub fn system_freezable_power_efficient() -> &'static Queue { // SAFETY: `system_freezable_power_efficient_wq` is a C global, always available. unsafe { Queue::from_raw(bindings::system_freezable_power_efficient_wq) } } + +/// Returns the system bottom halves work queue (`system_bh_wq`). +/// +/// It is similar to the one returned by [`system`] but for work items which +/// need to run from a softirq context. +pub fn system_bh() -> &'static Queue { + // SAFETY: `system_bh_wq` is a C global, always available. + unsafe { Queue::from_raw(bindings::system_bh_wq) } +} + +/// Returns the system bottom halves high-priority work queue (`system_bh_highpri_wq`). +/// +/// It is similar to the one returned by [`system_bh`] but for work items which +/// require higher scheduling priority. +pub fn system_bh_highpri() -> &'static Queue { + // SAFETY: `system_bh_highpri_wq` is a C global, always available. + unsafe { Queue::from_raw(bindings::system_bh_highpri_wq) } +} |