workqueue: Add RCU annotation for pwq list walk
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Fri, 15 Nov 2019 18:01:25 +0000 (19:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 26 Jan 2020 09:01:07 +0000 (10:01 +0100)
commit16128944c90749d0b88758bcf727c8e8af3b2f4e
treeee27ad36651f026b87928cda04120952634bd39e
parentb30a9b012a4e9b400a3e3caa0e4c83d77089ef7b
workqueue: Add RCU annotation for pwq list walk

[ Upstream commit 49e9d1a9faf2f71fdfd80a30697ee9a15070626d ]

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: 28875945ba98d ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/workqueue.c