dect
/
linux-2.6
Archived
13
0
Fork 0

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 <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Andrew Morton 2007-05-09 02:33:50 -07:00 committed by Linus Torvalds
parent a1e3cf418f
commit e18f3ffb9c
1 changed files with 2 additions and 2 deletions

View File

@ -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;