diff options
author | Andrew Morton <akpm@osdl.org> | 2007-05-09 11:33:50 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-09 21:30:50 +0200 |
commit | e18f3ffb9c3ddfc1b4ad8f38f5f2acae8c16f0c9 (patch) | |
tree | 6a1ccc7a10ccc25dd9b7e09fefa3db96e211e1ee /kernel/workqueue.c | |
parent | atmel_spi: remove unnecessary (and wrong) #ifdefs (diff) | |
download | linux-e18f3ffb9c3ddfc1b4ad8f38f5f2acae8c16f0c9.tar.xz linux-e18f3ffb9c3ddfc1b4ad8f38f5f2acae8c16f0c9.zip |
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>
Diffstat (limited to 'kernel/workqueue.c')
-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) 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; |