From: Andrew Morton Date: Wed, 9 May 2007 09:33:50 +0000 (-0700) Subject: schedule_on_each_cpu(): use preempt_disable() X-Git-Tag: v2.6.22-rc1~251 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e18f3ffb9c3ddfc1b4ad8f38f5f2acae8c16f0c9;p=linux-2.6-omap-h63xx.git schedule_on_each_cpu(): use preempt_disable() We take workqueue_mutex in there to keep CPU hotplug away. But preempt_disable() will suffice for that. Cc: Ingo Molnar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/workqueue.c b/kernel/workqueue.c index b6fa5e63085..1ea4bcb8697 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -638,7 +638,7 @@ int schedule_on_each_cpu(work_func_t func) if (!works) return -ENOMEM; - mutex_lock(&workqueue_mutex); + preempt_disable(); /* CPU hotplug */ for_each_online_cpu(cpu) { struct work_struct *work = per_cpu_ptr(works, cpu); @@ -646,7 +646,7 @@ int schedule_on_each_cpu(work_func_t func) set_bit(WORK_STRUCT_PENDING, work_data_bits(work)); __queue_work(per_cpu_ptr(keventd_wq->cpu_wq, cpu), work); } - mutex_unlock(&workqueue_mutex); + preempt_enable(); flush_workqueue(keventd_wq); free_percpu(works); return 0;