diff options
-rw-r--r-- | kernel/workqueue.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index b6fa5e63085d..1ea4bcb86974 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -638,7 +638,7 @@ int schedule_on_each_cpu(work_func_t func) | |||
638 | if (!works) | 638 | if (!works) |
639 | return -ENOMEM; | 639 | return -ENOMEM; |
640 | 640 | ||
641 | mutex_lock(&workqueue_mutex); | 641 | preempt_disable(); /* CPU hotplug */ |
642 | for_each_online_cpu(cpu) { | 642 | for_each_online_cpu(cpu) { |
643 | struct work_struct *work = per_cpu_ptr(works, cpu); | 643 | struct work_struct *work = per_cpu_ptr(works, cpu); |
644 | 644 | ||
@@ -646,7 +646,7 @@ int schedule_on_each_cpu(work_func_t func) | |||
646 | set_bit(WORK_STRUCT_PENDING, work_data_bits(work)); | 646 | set_bit(WORK_STRUCT_PENDING, work_data_bits(work)); |
647 | __queue_work(per_cpu_ptr(keventd_wq->cpu_wq, cpu), work); | 647 | __queue_work(per_cpu_ptr(keventd_wq->cpu_wq, cpu), work); |
648 | } | 648 | } |
649 | mutex_unlock(&workqueue_mutex); | 649 | preempt_enable(); |
650 | flush_workqueue(keventd_wq); | 650 | flush_workqueue(keventd_wq); |
651 | free_percpu(works); | 651 | free_percpu(works); |
652 | return 0; | 652 | return 0; |