aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/workqueue.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-01-16 18:31:15 -0500
committerIngo Molnar <mingo@elte.hu>2009-01-19 16:36:07 -0500
commit8ccad40df8d314f786fdb06bdbedd4f43f3257cd (patch)
tree7d3c1bde4ff36bb936a5934e602a4e1b50702545 /kernel/workqueue.c
parent31ad9081200c06ccc350625d41d1f8b2d1cef29f (diff)
work_on_cpu: Use our own workqueue.
Impact: remove potential clashes with generic kevent workqueue Annoyingly, some places we want to use work_on_cpu are already in workqueues. As per Ingo's suggestion, we create a different workqueue for work_on_cpu. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r--kernel/workqueue.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index a35afdbc0161..1f0c509b40d3 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -971,6 +971,8 @@ undo:
971} 971}
972 972
973#ifdef CONFIG_SMP 973#ifdef CONFIG_SMP
974static struct workqueue_struct *work_on_cpu_wq __read_mostly;
975
974struct work_for_cpu { 976struct work_for_cpu {
975 struct work_struct work; 977 struct work_struct work;
976 long (*fn)(void *); 978 long (*fn)(void *);
@@ -1001,7 +1003,7 @@ long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg)
1001 INIT_WORK(&wfc.work, do_work_for_cpu); 1003 INIT_WORK(&wfc.work, do_work_for_cpu);
1002 wfc.fn = fn; 1004 wfc.fn = fn;
1003 wfc.arg = arg; 1005 wfc.arg = arg;
1004 schedule_work_on(cpu, &wfc.work); 1006 queue_work_on(cpu, work_on_cpu_wq, &wfc.work);
1005 flush_work(&wfc.work); 1007 flush_work(&wfc.work);
1006 1008
1007 return wfc.ret; 1009 return wfc.ret;
@@ -1019,4 +1021,8 @@ void __init init_workqueues(void)
1019 hotcpu_notifier(workqueue_cpu_callback, 0); 1021 hotcpu_notifier(workqueue_cpu_callback, 0);
1020 keventd_wq = create_workqueue("events"); 1022 keventd_wq = create_workqueue("events");
1021 BUG_ON(!keventd_wq); 1023 BUG_ON(!keventd_wq);
1024#ifdef CONFIG_SMP
1025 work_on_cpu_wq = create_workqueue("work_on_cpu");
1026 BUG_ON(!work_on_cpu_wq);
1027#endif
1022} 1028}