diff options
author | Zhang Rui <rui.zhang@intel.com> | 2008-07-24 00:28:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:23 -0400 |
commit | c1a220e7acf8ad2c03504891f4a70cd9c32c904b (patch) | |
tree | 902104a5a5debb5b881d7af4110ad1258ea5b0bd /include | |
parent | 0d83304c7e7bd3b05be90281b3a47841bc8f057a (diff) |
pm: introduce new interfaces schedule_work_on() and queue_work_on()
This interface allows adding a job on a specific cpu.
Although a work struct on a cpu will be scheduled to other cpu if the cpu
dies, there is a recursion if a work task tries to offline the cpu it's
running on. we need to schedule the task to a specific cpu in this case.
http://bugzilla.kernel.org/show_bug.cgi?id=10897
[oleg@tv-sign.ru: cleanups]
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Rus <harbour@sfinx.od.ua>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/workqueue.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 542526c6e8ef..14d47120682b 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -179,6 +179,8 @@ __create_workqueue_key(const char *name, int singlethread, | |||
179 | extern void destroy_workqueue(struct workqueue_struct *wq); | 179 | extern void destroy_workqueue(struct workqueue_struct *wq); |
180 | 180 | ||
181 | extern int queue_work(struct workqueue_struct *wq, struct work_struct *work); | 181 | extern int queue_work(struct workqueue_struct *wq, struct work_struct *work); |
182 | extern int queue_work_on(int cpu, struct workqueue_struct *wq, | ||
183 | struct work_struct *work); | ||
182 | extern int queue_delayed_work(struct workqueue_struct *wq, | 184 | extern int queue_delayed_work(struct workqueue_struct *wq, |
183 | struct delayed_work *work, unsigned long delay); | 185 | struct delayed_work *work, unsigned long delay); |
184 | extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, | 186 | extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq, |
@@ -188,6 +190,7 @@ extern void flush_workqueue(struct workqueue_struct *wq); | |||
188 | extern void flush_scheduled_work(void); | 190 | extern void flush_scheduled_work(void); |
189 | 191 | ||
190 | extern int schedule_work(struct work_struct *work); | 192 | extern int schedule_work(struct work_struct *work); |
193 | extern int schedule_work_on(int cpu, struct work_struct *work); | ||
191 | extern int schedule_delayed_work(struct delayed_work *work, unsigned long delay); | 194 | extern int schedule_delayed_work(struct delayed_work *work, unsigned long delay); |
192 | extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, | 195 | extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, |
193 | unsigned long delay); | 196 | unsigned long delay); |