aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRik van Riel <riel@redhat.com>2014-06-04 16:33:15 -0400
committerIngo Molnar <mingo@kernel.org>2014-06-18 12:29:58 -0400
commitbb97fc31647539f1f102eed646a95e200160a150 (patch)
tree69a009dd0824b95572aab9c622357c032ea3c1cc
parenta43455a1d572daf7b730fe12eb747d1e17411365 (diff)
sched/numa: Always try to migrate to preferred node at task_numa_placement() time
It is possible that at task_numa_placement() time, the task's numa_preferred_nid does not change, but the task is not actually running on the preferred node at the time. In that case, we still want to attempt migration to the preferred node. Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: mgorman@suse.de Cc: Linus Torvalds <torvalds@linux-foundation.org> Link: http://lkml.kernel.org/r/20140604163315.1dbc7b56@cuia.bos.redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--kernel/sched/fair.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 8fbb0116bb5a..3fa3e1839c86 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1613,11 +1613,13 @@ static void task_numa_placement(struct task_struct *p)
1613 spin_unlock_irq(group_lock); 1613 spin_unlock_irq(group_lock);
1614 } 1614 }
1615 1615
1616 /* Preferred node as the node with the most faults */ 1616 if (max_faults) {
1617 if (max_faults && max_nid != p->numa_preferred_nid) { 1617 /* Set the new preferred node */
1618 /* Update the preferred nid and migrate task if possible */ 1618 if (max_nid != p->numa_preferred_nid)
1619 sched_setnuma(p, max_nid); 1619 sched_setnuma(p, max_nid);
1620 numa_migrate_preferred(p); 1620
1621 if (task_node(p) != p->numa_preferred_nid)
1622 numa_migrate_preferred(p);
1621 } 1623 }
1622} 1624}
1623 1625