History

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.

Rusty Russell committed 17 years ago

Commit 8ccad401 parent 31ad9081 file · +7 −1Browse files

Showing the changes to kernel/workqueue.c (1 of 1 file). Show all

Unified · Split

kernel/workqueue.c+7−1
@@ -971,6 +971,8 @@ undo: · 970 unmodified lines
971971 }
972972
973973 #ifdef CONFIG_SMP
974+static struct workqueue_struct *work_on_cpu_wq __read_mostly;
975+
974976 struct work_for_cpu {
975977 struct work_struct work;
976978 long (*fn)(void *);
@@ -1001,7 +1003,7 @@ long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) · 24 unmodified lines
10011003 INIT_WORK(&wfc.work, do_work_for_cpu);
10021004 wfc.fn = fn;
10031005 wfc.arg = arg;
1004− schedule_work_on(cpu, &wfc.work);
1006+ queue_work_on(cpu, work_on_cpu_wq, &wfc.work);
10051007 flush_work(&wfc.work);
10061008
10071009 return wfc.ret;
@@ -1019,4 +1021,8 @@ void __init init_workqueues(void) · 11 unmodified lines
10191021 hotcpu_notifier(workqueue_cpu_callback, 0);
10201022 keventd_wq = create_workqueue("events");
10211023 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
10221028 }