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
971}971}
972 972
973#ifdef CONFIG_SMP973#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) · 24 unmodified lines
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) · 11 unmodified lines
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}