diff options
| author | 2011-09-20 13:51:04 +1000 | |
|---|---|---|
| committer | 2011-09-20 15:52:38 +1000 | |
| commit | 1cce058b29e7eb8a71a72d8bb87eb7b4e0401c22 (patch) | |
| tree | 493477b7a19606c66de2f003bca83672f2164cad /kernel/workqueue.c | |
| parent | powerpc/ps3: Add gelic udbg driver (diff) | |
| parent | Merge branch 'irq-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip (diff) | |
Merge remote-tracking branch 'origin/master' into next
(Merge in order to get the PCIe mps/mrss code fixes)
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 || |
