aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/fair.c
diff options
context:
space:
mode:
authorRik van Riel <riel@redhat.com>2014-06-04 16:09:42 -0400
committerIngo Molnar <mingo@kernel.org>2014-06-18 12:29:57 -0400
commita43455a1d572daf7b730fe12eb747d1e17411365 (patch)
tree9522d6d36e5e6bbc92ab32c5aafc179ceaf668ee /kernel/sched/fair.c
parentebe06187bf2aec10d537ce4595e416035367d703 (diff)
sched/numa: Ensure task_numa_migrate() checks the preferred node
The first thing task_numa_migrate() does is check to see if there is CPU capacity available on the preferred node, in order to move the task there. However, if the preferred node is all busy, we would skip considering that node for tasks swaps in the subsequent loop. This prevents NUMA convergence of tasks on busy systems. However, swapping locations with a task on our preferred nid, when the preferred nid is busy, is perfectly fine. The fix is to also look for a CPU on our preferred nid when it is totally busy. This changes "perf bench numa mem -p 4 -t 20 -m -0 -P 1000" from not converging in 15 minutes on my 4 node system, to converging in 10-20 seconds. 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/20140604160942.6969b101@cuia.bos.redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r--kernel/sched/fair.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index fea7d3335e1f..8fbb0116bb5a 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1302,9 +1302,8 @@ static int task_numa_migrate(struct task_struct *p)
1302 groupimp = group_weight(p, env.dst_nid) - groupweight; 1302 groupimp = group_weight(p, env.dst_nid) - groupweight;
1303 update_numa_stats(&env.dst_stats, env.dst_nid); 1303 update_numa_stats(&env.dst_stats, env.dst_nid);
1304 1304
1305 /* If the preferred nid has free capacity, try to use it. */ 1305 /* Try to find a spot on the preferred nid. */
1306 if (env.dst_stats.has_free_capacity) 1306 task_numa_find_cpu(&env, taskimp, groupimp);
1307 task_numa_find_cpu(&env, taskimp, groupimp);
1308 1307
1309 /* No space available on the preferred nid. Look elsewhere. */ 1308 /* No space available on the preferred nid. Look elsewhere. */
1310 if (env.best_cpu == -1) { 1309 if (env.best_cpu == -1) {