]> git.ipfire.org Git - thirdparty/linux.git/commit
workqueue: drop apply_wqattrs_lock()/unlock() wrappers
authorBreno Leitao <leitao@debian.org>
Mon, 11 May 2026 12:14:18 +0000 (05:14 -0700)
committerTejun Heo <tj@kernel.org>
Mon, 11 May 2026 18:58:15 +0000 (08:58 -1000)
commitdfca46365afc030fb09bb40226514c500202dcdc
tree078dadb5eb28a9f3acc6969505a647da7bc174cd
parent7fcb7afb9b5eecb85904b16747b6eb04b0880c3b
workqueue: drop apply_wqattrs_lock()/unlock() wrappers

The apply_wqattrs_lock()/unlock() helpers were introduced by
commit a0111cf6710b ("workqueue: separate out and refactor the locking
of applying attrs") to encapsulate the get_online_cpus() (later
cpus_read_lock()) + mutex_lock(&wq_pool_mutex) acquire pair that was
duplicated across the apply-attrs paths.

Since commit 19af45757383 ("workqueue: Remove cpus_read_lock() from
apply_wqattrs_lock()") removed the cpus_read_lock() (pwq creation and
installation now operate on wq_online_cpumask, so CPU hotplug no longer
needs to be excluded), the wrappers have been one-line forwarders to
mutex_lock(&wq_pool_mutex)/mutex_unlock(&wq_pool_mutex).

They no longer encode any non-trivial locking rule and obscure the fact
that callers just take the existing wq_pool_mutex. This align with the
"unnecessary" helpers that got discussed in [1]

Inline the eight call sites and remove the wrappers. No functional
change.

Link: https://lore.kernel.org/all/afs_44-6ToJJVZTn@gmail.com/
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c