summaryrefslogtreecommitdiff
path: root/kernel/workqueue_internal.h
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2014-05-20 09:46:28 (GMT)
committerTejun Heo <tj@kernel.org>2014-05-20 14:59:30 (GMT)
commit73eb7fe73ae303996187fff38b1c162f1df0e9d1 (patch)
treeeef7c9e2ff094ba4052e3062fbbe975c69f90914 /kernel/workqueue_internal.h
parent9625ab1727743f6a164df26b7b1eeeced7380b42 (diff)
downloadlinux-73eb7fe73ae303996187fff38b1c162f1df0e9d1.tar.xz
workqueue: destroy_worker() should destroy idle workers only
We used to have the CPU online failure path where a worker is created and then destroyed without being started. A worker was created for the CPU coming online and if the online operation failed the created worker was shut down without being started. But this behavior was changed. The first worker is created and started at the same time for the CPU coming online. It means that we had already ensured in the code that destroy_worker() destroys only idle workers and we don't want to allow it to destroy any non-idle worker in the future. Otherwise, it may be buggy and it may be extremely hard to check. We should force destroy_worker() to destroy only idle workers explicitly. Since destroy_worker() destroys only idle workers, this patch does not change any functionality. We just need to update the comments and the sanity check code. In the sanity check code, we will refuse to destroy the worker if !(worker->flags & WORKER_IDLE). If the worker entered idle which means it is already started, so we remove the check of "worker->flags & WORKER_STARTED", after this removal, WORKER_STARTED is totally unneeded, so we remove WORKER_STARTED too. In the comments for create_worker(), "Create a new worker which is bound..." is changed to "... which is attached..." due to we change the name of this behavior to attaching. tj: Minor description / comment updates. Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/workqueue_internal.h')
0 files changed, 0 insertions, 0 deletions