diff --git a/[refs] b/[refs] index 4cb13e1bf88a..86a9ed7f780c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: df4e33ad249b7480d6ba5dd11fc1dac5cfaffce1 +refs/heads/master: fa2563e41c3d6d6e8af437643981ed28ae0cb56d diff --git a/trunk/kernel/workqueue.c b/trunk/kernel/workqueue.c index 25fb1b0e53fa..1783aabc6128 100644 --- a/trunk/kernel/workqueue.c +++ b/trunk/kernel/workqueue.c @@ -2412,8 +2412,13 @@ void drain_workqueue(struct workqueue_struct *wq) 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 ||