diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2011-10-24 13:42:08 +0200 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-10-24 13:42:08 +0200 |
commit | a853ba8d6d5d76bcbc5bf35b945b5727b5e5a36d (patch) | |
tree | 8faa7c17a8babd6b6fd63e13b85799a881e31956 /kernel/workqueue.c | |
parent | 5bdb7613414a9884166b2f5f20ad0353c1c6b6f3 (diff) | |
parent | c3b92c8787367a8bb53d57d9789b558f1295cc96 (diff) | |
download | linux-a853ba8d6d5d76bcbc5bf35b945b5727b5e5a36d.tar.bz2 |
Merge commit 'v3.1' into spi/next
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 7 |
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 || |