aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRik van Riel <riel@redhat.com>2013-10-07 06:29:19 -0400
committerIngo Molnar <mingo@kernel.org>2013-10-09 08:47:43 -0400
commite1dda8a797b59d7ec4b17e393152ec3273a552d5 (patch)
tree256769c0da413cb1d5fcaeabd06316d24804259c /kernel
parent2c8a50aa873a7e1d6cc0913362051ff9912dc6ca (diff)
sched/numa: Fix placement of workloads spread across multiple nodes
The load balancer will spread workloads across multiple NUMA nodes, in order to balance the load on the system. This means that sometimes a task's preferred node has available capacity, but moving the task there will not succeed, because that would create too large an imbalance. In that case, other NUMA nodes need to be considered. Signed-off-by: Rik van Riel <riel@redhat.com> Signed-off-by: Mel Gorman <mgorman@suse.de> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1381141781-10992-42-git-send-email-mgorman@suse.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched/fair.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 09aac90df89e..aa561c8dc899 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -1104,13 +1104,12 @@ static int task_numa_migrate(struct task_struct *p)
1104 imp = task_faults(env.p, env.dst_nid) - faults; 1104 imp = task_faults(env.p, env.dst_nid) - faults;
1105 update_numa_stats(&env.dst_stats, env.dst_nid); 1105 update_numa_stats(&env.dst_stats, env.dst_nid);
1106 1106
1107 /* 1107 /* If the preferred nid has capacity, try to use it. */
1108 * If the preferred nid has capacity then use it. Otherwise find an 1108 if (env.dst_stats.has_capacity)
1109 * alternative node with relatively better statistics.
1110 */
1111 if (env.dst_stats.has_capacity) {
1112 task_numa_find_cpu(&env, imp); 1109 task_numa_find_cpu(&env, imp);
1113 } else { 1110
1111 /* No space available on the preferred nid. Look elsewhere. */
1112 if (env.best_cpu == -1) {
1114 for_each_online_node(nid) { 1113 for_each_online_node(nid) {
1115 if (nid == env.src_nid || nid == p->numa_preferred_nid) 1114 if (nid == env.src_nid || nid == p->numa_preferred_nid)
1116 continue; 1115 continue;