aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRik van Riel <[email protected]>2013-10-07 11:29:12 +0100
committerIngo Molnar <[email protected]>2013-10-09 12:40:41 +0200
commit06ea5e035b4e66cc77790457a89fc7e368060c4b (patch)
tree225dd9d1d180dcca19cce9ce8c3762b9c1cee7dc
parent6b9a7460b6baf6c77fc3d23d927ddfc3f3f05bf3 (diff)
sched/numa: Increment numa_migrate_seq when task runs in correct location
When a task is already running on its preferred node, increment numa_migrate_seq to indicate that the task is settled if migration is temporarily disabled, and memory should migrate towards it. Signed-off-by: Rik van Riel <[email protected]> [ Only increment migrate_seq if migration temporarily disabled. ] Signed-off-by: Mel Gorman <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Srikar Dronamraju <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r--kernel/sched/fair.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f84ac3fb581b..de9b4d8eb853 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1016,8 +1016,16 @@ static void numa_migrate_preferred(struct task_struct *p)
{
/* Success if task is already running on preferred CPU */
p->numa_migrate_retry = 0;
- if (cpu_to_node(task_cpu(p)) == p->numa_preferred_nid)
+ if (cpu_to_node(task_cpu(p)) == p->numa_preferred_nid) {
+ /*
+ * If migration is temporarily disabled due to a task migration
+ * then re-enable it now as the task is running on its
+ * preferred node and memory should migrate locally
+ */
+ if (!p->numa_migrate_seq)
+ p->numa_migrate_seq++;
return;
+ }
/* This task has no NUMA fault statistics yet */
if (unlikely(p->numa_preferred_nid == -1))