Skip to content

Commit d355001

Browse files
committed
workqueue: Use rcu_read_lock_any_held() instead of rcu_read_lock_held()
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>
1 parent c7a40c4 commit d355001

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/workqueue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,12 +515,12 @@ static void show_one_worker_pool(struct worker_pool *pool);
515515
#include <trace/events/workqueue.h>
516516

517517
#define assert_rcu_or_pool_mutex() \
518-
RCU_LOCKDEP_WARN(!rcu_read_lock_held() && \
518+
RCU_LOCKDEP_WARN(!rcu_read_lock_any_held() && \
519519
!lockdep_is_held(&wq_pool_mutex), \
520520
"RCU or wq_pool_mutex should be held")
521521

522522
#define assert_rcu_or_wq_mutex_or_pool_mutex(wq) \
523-
RCU_LOCKDEP_WARN(!rcu_read_lock_held() && \
523+
RCU_LOCKDEP_WARN(!rcu_read_lock_any_held() && \
524524
!lockdep_is_held(&wq->mutex) && \
525525
!lockdep_is_held(&wq_pool_mutex), \
526526
"RCU, wq->mutex or wq_pool_mutex should be held")

0 commit comments

Comments
 (0)