diff options
author | Rik van Riel <riel@redhat.com> | 2014-08-04 19:23:27 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-08-12 12:48:22 +0200 |
commit | b932c03c34f3b03c7364c06aa8cae5b74609fc41 (patch) | |
tree | 8be6adf0a790ddec698483143800893e791a3d3c /kernel/sched/fair.c | |
parent | sched: Rename a misleading variable in build_overlap_sched_groups() (diff) | |
download | linux-b932c03c34f3b03c7364c06aa8cae5b74609fc41.tar.xz linux-b932c03c34f3b03c7364c06aa8cae5b74609fc41.zip |
sched/numa: Fix off-by-one in capacity check
Commit a43455a1d572daf7b730fe12eb747d1e17411365 ensures that
task_numa_migrate will call task_numa_compare on the preferred
node all the time, even when the preferred node has no free capacity.
This could lead to a performance regression if nr_running == capacity
on both the source and the destination node. This can be avoided by
also checking for nr_running == capacity on the source node, which is
one stricter than checking .has_free_capacity.
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: mgorman@suse.de
Cc: vincent.guittot@linaro.org
Cc: Morten.Rasmussen@arm.com
Cc: nicolas.pitre@linaro.org
Cc: efault@gmx.de
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1407173008-9334-2-git-send-email-riel@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/sched/fair.c')
-rw-r--r-- | kernel/sched/fair.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index df1ed176c7b7..e1cf419c3c7f 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1206,7 +1206,7 @@ static void task_numa_compare(struct task_numa_env *env, if (!cur) { /* Is there capacity at our destination? */ - if (env->src_stats.has_free_capacity && + if (env->src_stats.nr_running <= env->src_stats.task_capacity && !env->dst_stats.has_free_capacity) goto unlock; |