diff options
| author | Rusty Russell <rusty@rustcorp.com.au> | 2009-01-16 18:31:15 -0500 |
|---|---|---|
| committer | Mike Travis <travis@sgi.com> | 2009-01-16 18:31:15 -0500 |
| commit | e1d9ec6246a2668a5d037f529877efb7cf176af8 (patch) | |
| tree | 58873891cffbb657cf7820ff0a32f03eea830f80 /kernel/workqueue.c | |
| parent | 68564a46976017496c2227660930d81240f82355 (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>
Diffstat (limited to 'kernel/workqueue.c')
| -rw-r--r-- | kernel/workqueue.c | 8 |
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 |
| 974 | static struct workqueue_struct *work_on_cpu_wq __read_mostly; | ||
| 975 | |||
| 974 | struct work_for_cpu { | 976 | struct 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 | } |
