]> git.baikalelectronics.ru Git - kernel.git/commit
workqueue: make the workqueues list RCU walkable
authorTejun Heo <tj@kernel.org>
Mon, 9 Mar 2015 13:22:28 +0000 (09:22 -0400)
committerTejun Heo <tj@kernel.org>
Mon, 9 Mar 2015 13:22:28 +0000 (09:22 -0400)
commit83387defd81a7555aebe39045d22a3e20a9d7ffa
tree3b86a4dfbc600872645c856d3d45b8b3af4d3cff
parenta0044361e32d9ee7d0b41336d2c1e76fa63ae683
workqueue: make the workqueues list RCU walkable

The workqueues list is protected by wq_pool_mutex and a workqueue and
its subordinate data structures are freed directly on destruction.  We
want to add the ability dump workqueues from a sysrq callback which
requires walking all workqueues without grabbing wq_pool_mutex.  This
patch makes freeing of workqueues RCU protected and makes the
workqueues list walkable while holding RCU read lock.

Note that pool_workqueues and pools are already sched-RCU protected.
For consistency, workqueues are also protected with sched-RCU.

While at it, reverse the workqueues list so that a workqueue which is
created earlier comes before.  The order of the list isn't significant
functionally but this makes the planned sysrq dump list system
workqueues first.

Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c