aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-05-09 23:25:57 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-05-09 23:25:57 -0700
commitfa8f2c5000cafcaa87182c5f2c021ae1ae52299c (patch)
treebd478a07d90971bc9bb2a05e96d0f1f0ed0327d8 /kernel
parent1ec430966896297cd850a36f1ac082a79de30eca (diff)
downloadhistory-fa8f2c5000cafcaa87182c5f2c021ae1ae52299c.tar.gz
[PATCH] Reduce TLB flushing during process migration
From: Martin Hicks <mort@wildopensource.com> Another optimization patch from Jack Steiner, intended to reduce TLB flushes during process migration. Most architextures should define tlb_migrate_prepare() to be flush_tlb_mm(), but on i386, it would be a wasted flush, because i386 disconnects previous cpus from the tlb flush automatically.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 025f04bfdf5ce..94e19f1a55801 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -26,6 +26,8 @@
#include <linux/highmem.h>
#include <linux/smp_lock.h>
#include <asm/mmu_context.h>
+#include <linux//pagemap.h>
+#include <asm/tlb.h>
#include <linux/interrupt.h>
#include <linux/completion.h>
#include <linux/kernel_stat.h>
@@ -1127,6 +1129,14 @@ static void sched_migrate_task(task_t *p, int dest_cpu)
task_rq_unlock(rq, &flags);
wake_up_process(rq->migration_thread);
wait_for_completion(&req.done);
+
+ /*
+ * we want a new context here. This eliminates TLB
+ * flushes on the cpus where the process executed prior to
+ * the migration.
+ */
+ tlb_migrate_prepare(current->mm);
+
return;
}
out: