]> git.infradead.org Git - users/hch/xfs.git/commit
workqueue: Put PWQ allocation and WQ enlistment in the same lock C.S.
authorLai Jiangshan <jiangshan.ljs@antgroup.com>
Thu, 4 Jul 2024 03:49:13 +0000 (11:49 +0800)
committerTejun Heo <tj@kernel.org>
Fri, 5 Jul 2024 19:14:40 +0000 (09:14 -1000)
commit1726a17135905e2d2773f18d47bd4e17dd26e1ed
treeab35baf8e93afe1b7a1f66815476a0ea382b6f5d
parent4e9a37389ec2d062e02f6647d1d60c3d11150896
workqueue: Put PWQ allocation and WQ enlistment in the same lock C.S.

The PWQ allocation and WQ enlistment are not within the same lock-held
critical section; therefore, their states can become out of sync when
the user modifies the unbound mask or if CPU hotplug events occur in
the interim since those operations only update the WQs that are already
in the list.

Make the PWQ allocation and WQ enlistment atomic.

Signed-off-by: Lai Jiangshan <jiangshan.ljs@antgroup.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/workqueue.c