]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - kernel/workqueue.c
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)
commite2dca7adff8f3fae0ab250a6362798550b3c79ee
tree3b86a4dfbc600872645c856d3d45b8b3af4d3cff
parent8603e1b30027f943cc9c1eef2b291d42c3347af1
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