]> www.infradead.org Git - users/jedix/linux-maple.git/commit
workqueue: wq_pool_mutex protects the attrs-installation
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 12 May 2015 12:32:29 +0000 (20:32 +0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:45:13 +0000 (15:45 -0700)
commit89581e5844ec06f296ec5d10dbd8785ff4bd73f0
tree2cf84c50bc2ca81b2ed731b0e36a64560d31b85b
parente212863cb3160f2e455464e1465ce0481bf25853
workqueue: wq_pool_mutex protects the attrs-installation

Orabug: 23330878

Orabug: 23330878

Current wq_pool_mutex doesn't proctect the attrs-installation, it results
that ->unbound_attrs, ->numa_pwq_tbl[] and ->dfl_pwq can only be accessed
under wq->mutex and causes some inconveniences. Example, wq_update_unbound_numa()
has to acquire wq->mutex before fetching the wq->unbound_attrs->no_numa
and the old_pwq.

attrs-installation is a short operation, so this change will no cause any
latency for other operations which also acquire the wq_pool_mutex.

The only unprotected attrs-installation code is in apply_workqueue_attrs(),
so this patch touches code less than comments.

It is also a preparation patch for next several patches which read
wq->unbound_attrs, wq->numa_pwq_tbl[] and wq->dfl_pwq with
only wq_pool_mutex held.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Dan Duval <dan.duval@oracle.com>
(cherry picked from commit 5b95e1af8d17d85a17728f6de7dbff538e6e3c49)

Conflict:

kernel/workqueue.c

Signed-off-by: Dan Duval <dan.duval@oracle.com>
(cherry picked from commit 488d0fa4a729243e23865458cf6deb7841f0d8c3)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
kernel/workqueue.c