summaryrefslogtreecommitdiff
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-10-28 09:16:43 +0400
committerPaul Mundt <lethal@linux-sh.org>2011-10-28 09:16:43 +0400
commitd4d9781d1dd04ff134e3d43383dfa9991f7c54c6 (patch)
tree28e799ec49f72bf37f39d192d21f25bffb682aab /kernel/workqueue.c
parentf5a18f932e051ff0f19dcd80a421a4dd9b11f10f (diff)
parent396e6e49c58bb23d1814d3c240c736c9f01523c5 (diff)
downloadlinux-d4d9781d1dd04ff134e3d43383dfa9991f7c54c6.tar.xz
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into sh-latest
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 25fb1b0e53fa..1783aabc6128 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2412,8 +2412,13 @@ reflush:
for_each_cwq_cpu(cpu, wq) {
struct cpu_workqueue_struct *cwq = get_cwq(cpu, wq);
+ bool drained;
- if (!cwq->nr_active && list_empty(&cwq->delayed_works))
+ spin_lock_irq(&cwq->gcwq->lock);
+ drained = !cwq->nr_active && list_empty(&cwq->delayed_works);
+ spin_unlock_irq(&cwq->gcwq->lock);
+
+ if (drained)
continue;
if (++flush_cnt == 10 ||