diff options
author | Tejun Heo <tj@kernel.org> | 2010-12-20 18:32:04 (GMT) |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-12-20 18:32:04 (GMT) |
commit | c8efcc2589464ac70255bb83e10cad61c7c6d295 (patch) | |
tree | a7f9c975831344ba78d3a2f9d252749d0479ca2b /virt/kvm | |
parent | ed41390fa57a21d06e6e3a3c4bc238bab8957fbb (diff) | |
download | linux-c8efcc2589464ac70255bb83e10cad61c7c6d295.tar.xz |
workqueue: allow chained queueing during destruction
Currently, destroy_workqueue() makes the workqueue deny all new
queueing by setting WQ_DYING and flushes the workqueue once before
proceeding with destruction; however, there are cases where work items
queue more related work items. Currently, such users need to
explicitly flush the workqueue multiple times depending on the
possible depth of such chained queueing.
This patch updates the queueing path such that a work item can queue
further work items on the same workqueue even when WQ_DYING is set.
The flush on destruction is automatically retried until the workqueue
is empty. This guarantees that the workqueue is empty on destruction
while allowing chained queueing.
The flush retry logic whines if it takes too many retries to drain the
workqueue.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'virt/kvm')
0 files changed, 0 insertions, 0 deletions