diff options
author | Christoph Lameter <clameter@engr.sgi.com> | 2006-01-08 04:00:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-08 23:12:40 -0500 |
commit | 15316ba81aee6775d6079fb46c66c801989e7d10 (patch) | |
tree | c6190bdcc6e15fd8b5657a5932313e296b475577 /include | |
parent | 48db57f8ff10eb09ab887ccb6150b0da0c7be24e (diff) |
[PATCH] add schedule_on_each_cpu()
swap migration's isolate_lru_page() currently uses an IPI to notify other
processors that the lru caches need to be drained if the page cannot be
found on the LRU. The IPI interrupt may interrupt a processor that is just
processing lru requests and cause a race condition.
This patch introduces a new function run_on_each_cpu() that uses the
keventd() to run the LRU draining on each processor. Processors disable
preemption when dealing the LRU caches (these are per processor) and thus
executing LRU draining from another process is safe.
Thanks to Lee Schermerhorn <lee.schermerhorn@hp.com> for finding this race
condition.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/workqueue.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index ac39d04d027c..86b111300231 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -65,6 +65,7 @@ extern int FASTCALL(schedule_work(struct work_struct *work)); | |||
65 | extern int FASTCALL(schedule_delayed_work(struct work_struct *work, unsigned long delay)); | 65 | extern int FASTCALL(schedule_delayed_work(struct work_struct *work, unsigned long delay)); |
66 | 66 | ||
67 | extern int schedule_delayed_work_on(int cpu, struct work_struct *work, unsigned long delay); | 67 | extern int schedule_delayed_work_on(int cpu, struct work_struct *work, unsigned long delay); |
68 | extern int schedule_on_each_cpu(void (*func)(void *info), void *info); | ||
68 | extern void flush_scheduled_work(void); | 69 | extern void flush_scheduled_work(void); |
69 | extern int current_is_keventd(void); | 70 | extern int current_is_keventd(void); |
70 | extern int keventd_up(void); | 71 | extern int keventd_up(void); |