1
0
Fork 0

workqueue: Add RCU annotation for pwq list walk

An additional check has been recently added to ensure that a RCU related lock
is held while the RCU list is iterated.
The `pwqs' are sometimes iterated without a RCU lock but with the &wq->mutex
acquired leading to a warning.

Teach list_for_each_entry_rcu() that the RCU usage is okay if &wq->mutex
is acquired during the list traversal.

Fixes: 28875945ba ("rcu: Add support for consolidated-RCU reader checking")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Tejun Heo <tj@kernel.org>
alistair/sunxi64-5.5-dsi
Sebastian Andrzej Siewior 2019-11-15 19:01:25 +01:00 committed by Tejun Heo
parent e66b39af00
commit 49e9d1a9fa
1 changed files with 2 additions and 1 deletions

View File

@ -426,7 +426,8 @@ static void show_pwq(struct pool_workqueue *pwq);
* ignored.
*/
#define for_each_pwq(pwq, wq) \
list_for_each_entry_rcu((pwq), &(wq)->pwqs, pwqs_node) \
list_for_each_entry_rcu((pwq), &(wq)->pwqs, pwqs_node, \
lockdep_is_held(&wq->mutex)) \
if (({ assert_rcu_or_wq_mutex(wq); false; })) { } \
else