提交 b932c03c 编写于 作者: R Rik van Riel 提交者: Ingo Molnar

sched/numa: Fix off-by-one in capacity check

Commit a43455a1 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: NRik van Riel <riel@redhat.com>
Signed-off-by: NPeter 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.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 aaecac4a
...@@ -1206,7 +1206,7 @@ static void task_numa_compare(struct task_numa_env *env, ...@@ -1206,7 +1206,7 @@ static void task_numa_compare(struct task_numa_env *env,
if (!cur) { if (!cur) {
/* Is there capacity at our destination? */ /* 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) !env->dst_stats.has_free_capacity)
goto unlock; goto unlock;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册