linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] AutoPage Migration - V0.1 - 6/8 hook sched migrate to memory migration
@ 2006-03-10 19:52 Lee Schermerhorn
  2006-03-10 19:59 ` Lee Schermerhorn
  0 siblings, 1 reply; 2+ messages in thread
From: Lee Schermerhorn @ 2006-03-10 19:52 UTC (permalink / raw)
  To: linux-mm

AutoPage Migration - V0.1 - 6/8 hook sched migrate to memory migration

Add check for internode migration to scheduler -- in most places
where a new cpu is assigned via set_task_cpu().  If MIGRATION is
configured, and sched_migrate_memory is enabled [and this is a
user space task], the check will set "migration pending" for the
task if the destination cpu is on a different cpu from the last
cpu to which the task was assigned.  Migration of affected pages
[those with default policy] will occur when the task returns to
user space.

Signed-off-by:  Lee Schermerhorn <lee.schermerhorn@hp.com>

Index: linux-2.6.16-rc5-git11/kernel/sched.c
===================================================================
--- linux-2.6.16-rc5-git11.orig/kernel/sched.c	2006-03-08 15:44:30.000000000 -0500
+++ linux-2.6.16-rc5-git11/kernel/sched.c	2006-03-08 16:39:42.000000000 -0500
@@ -52,6 +52,7 @@
 #include <asm/tlb.h>
 
 #include <asm/unistd.h>
+#include <linux/auto-migrate.h>
 
 /*
  * Convert user-nice values [ -20 ... 0 ... 19 ]
@@ -880,6 +881,7 @@ static int migrate_task(task_t *p, int d
 	 * it is sufficient to simply update the task's cpu field.
 	 */
 	if (!p->array && !task_running(rq, p)) {
+		check_internode_migration(p, dest_cpu);
 		set_task_cpu(p, dest_cpu);
 		return 0;
 	}
@@ -1260,6 +1262,7 @@ static int try_to_wake_up(task_t *p, uns
 out_set_cpu:
 	new_cpu = wake_idle(new_cpu, p);
 	if (new_cpu != cpu) {
+		check_internode_migration(p, new_cpu);
 		set_task_cpu(p, new_cpu);
 		task_rq_unlock(rq, &flags);
 		/* might preempt at this point */
@@ -1778,6 +1781,7 @@ void pull_task(runqueue_t *src_rq, prio_
 {
 	dequeue_task(p, src_array);
 	src_rq->nr_running--;
+	check_internode_migration(p, this_cpu);
 	set_task_cpu(p, this_cpu);
 	this_rq->nr_running++;
 	enqueue_task(p, this_array);
@@ -4452,6 +4456,7 @@ static void __migrate_task(struct task_s
 	if (!cpu_isset(dest_cpu, p->cpus_allowed))
 		goto out;
 
+	check_internode_migration(p, dest_cpu);
 	set_task_cpu(p, dest_cpu);
 	if (p->array) {
 		/*


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-03-10 19:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-10 19:52 [PATCH/RFC] AutoPage Migration - V0.1 - 6/8 hook sched migrate to memory migration Lee Schermerhorn
2006-03-10 19:59 ` Lee Schermerhorn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox