aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-06-08 18:18:20 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-06-08 18:18:20 -0700
commit515f9252f6c004a1b5b34554e40efaa60379565c (patch)
treecd6c5df6830e6207454f26c4072e6a3b2519cb7e /kernel
parentf1b2f7fff5c6e2d784f3f930e11c6bc980613bb0 (diff)
downloadhistory-515f9252f6c004a1b5b34554e40efaa60379565c.tar.gz
[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: Anil Keshavamurthy <anil.s.keshavamurthy@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/workqueue.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index ee54ac9a948398..987fbc2986d889 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -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,