Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 60773
b: refs/heads/master
c: 13c2216
h: refs/heads/master
i:
  60771: 91a463b
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Jul 17, 2007
1 parent 6d31d7a commit c62111e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 87a7defb0d4255d5aea2c5067813b26836127983
refs/heads/master: 13c22168b7276dffe49dc66675d5a78f6d288e0d
11 changes: 5 additions & 6 deletions trunk/kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -752,18 +752,17 @@ static void cleanup_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu)
if (cwq->thread == NULL)
return;

flush_cpu_workqueue(cwq);
/*
* If the caller is CPU_DEAD the single flush_cpu_workqueue()
* is not enough, a concurrent flush_workqueue() can insert a
* barrier after us.
* If the caller is CPU_DEAD and cwq->worklist was not empty,
* a concurrent flush_workqueue() can insert a barrier after us.
* However, in that case run_workqueue() won't return and check
* kthread_should_stop() until it flushes all work_struct's.
* When ->worklist becomes empty it is safe to exit because no
* more work_structs can be queued on this cwq: flush_workqueue
* checks list_empty(), and a "normal" queue_work() can't use
* a dead CPU.
*/
while (flush_cpu_workqueue(cwq))
;

kthread_stop(cwq->thread);
cwq->thread = NULL;
}
Expand Down

0 comments on commit c62111e

Please sign in to comment.