Commit 515f9252 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] flush_workqueue locking simplification

From: "Anil" <anil.s.keshavamurthy@intel.com>

We don't need lock_cpu_hotplug()/unlock_cpu_hotplug for singlethreaded
workqueues.
Signed-off-by: default avatarAnil Keshavamurthy <anil.s.keshavamurthy@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f1b2f7ff
......@@ -262,7 +262,6 @@ static void flush_cpu_workqueue(struct cpu_workqueue_struct *cwq)
void fastcall flush_workqueue(struct workqueue_struct *wq)
{
might_sleep();
lock_cpu_hotplug();
if (is_single_threaded(wq)) {
/* Always use cpu 0's area. */
......@@ -270,11 +269,11 @@ void fastcall flush_workqueue(struct workqueue_struct *wq)
} else {
int cpu;
lock_cpu_hotplug();
for_each_online_cpu(cpu)
flush_cpu_workqueue(wq->cpu_wq + cpu);
unlock_cpu_hotplug();
}
unlock_cpu_hotplug();
}
static struct task_struct *create_workqueue_thread(struct workqueue_struct *wq,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment