Skip to contentSkip to conversation

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

PATCH/RFC Lee Schermerhorn 1 participant 2 messages Mar 10, 2006 Memory management

lore
Share & tools
lore
#0 lore raw

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.

kernel/sched.c +5 -0
Index: linux-2.6.16-rc5-git11/kernel/sched.c
===================================================================
@@ -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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#1 lore raw
Quoted 7 lines · Lee Schermerhorn

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

:-( ^-node

Quoted 5 lines

cpu to which the task was assigned. Migration of affected pages [those with default policy] will occur when the task returns to user space.

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