]> www.infradead.org Git - linux.git/commitdiff
workqueue: Use rcu_read_lock_any_held() instead of rcu_read_lock_held()
authorTejun Heo <tj@kernel.org>
Wed, 21 Feb 2024 05:36:13 +0000 (19:36 -1000)
committerTejun Heo <tj@kernel.org>
Wed, 21 Feb 2024 05:36:13 +0000 (19:36 -1000)
The different flavors of RCU read critical sections have been unified. Let's
update the locking assertion macros accordingly to avoid requiring
unnecessary explicit rcu_read_[un]lock() calls.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Lai Jiangshan <jiangshanlai@gmail.com>
kernel/workqueue.c

index b280caf81fb29443e4d1688320d53f7569242eb7..87750e70b6383e61368d68295a6bad2db9c773a9 100644 (file)
@@ -515,12 +515,12 @@ static void show_one_worker_pool(struct worker_pool *pool);
 #include <trace/events/workqueue.h>
 
 #define assert_rcu_or_pool_mutex()                                     \
-       RCU_LOCKDEP_WARN(!rcu_read_lock_held() &&                       \
+       RCU_LOCKDEP_WARN(!rcu_read_lock_any_held() &&                   \
                         !lockdep_is_held(&wq_pool_mutex),              \
                         "RCU or wq_pool_mutex should be held")
 
 #define assert_rcu_or_wq_mutex_or_pool_mutex(wq)                       \
-       RCU_LOCKDEP_WARN(!rcu_read_lock_held() &&                       \
+       RCU_LOCKDEP_WARN(!rcu_read_lock_any_held() &&                   \
                         !lockdep_is_held(&wq->mutex) &&                \
                         !lockdep_is_held(&wq_pool_mutex),              \
                         "RCU, wq->mutex or wq_pool_mutex should be held")