diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2014-04-18 11:04:16 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-06-07 13:25:37 -0700 |
commit | f56fb0d42b47b87b12c4936a77429d9dd1c7c4c6 (patch) | |
tree | 7da54c27dbade8b893c87bbd7232dcca910617b3 /drivers/bus | |
parent | aac8b37ffaa2bacc0430aa7b45c7d3aad22209fc (diff) | |
download | lwn-f56fb0d42b47b87b12c4936a77429d9dd1c7c4c6.tar.gz lwn-f56fb0d42b47b87b12c4936a77429d9dd1c7c4c6.zip |
workqueue: make rescuer_thread() empty wq->maydays list before exiting
commit 4d595b866d2c653dc90a492b9973a834eabfa354 upstream.
After a @pwq is scheduled for emergency execution, other workers may
consume the affectd work items before the rescuer gets to them. This
means that a workqueue many have pwqs queued on @wq->maydays list
while not having any work item pending or in-flight. If
destroy_workqueue() executes in such condition, the rescuer may exit
without emptying @wq->maydays.
This currently doesn't cause any actual harm. destroy_workqueue() can
safely destroy all the involved data structures whether @wq->maydays
is populated or not as nobody access the list once the rescuer exits.
However, this is nasty and makes future development difficult. Let's
update rescuer_thread() so that it empties @wq->maydays after seeing
should_stop to guarantee that the list is empty on rescuer exit.
tj: Updated comment and patch description.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/bus')
0 files changed, 0 insertions, 0 deletions