sched/numa: Fix off-by-one in capacity check
authorRik van Riel <riel@redhat.com>
Mon, 4 Aug 2014 17:23:27 +0000 (13:23 -0400)
committerIngo Molnar <mingo@kernel.org>
Tue, 12 Aug 2014 10:48:22 +0000 (12:48 +0200)
commitb932c03c34f3b03c7364c06aa8cae5b74609fc41
tree8be6adf0a790ddec698483143800893e791a3d3c
parentaaecac4ad46b35ad308245384d019633fb9bc21b
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>
kernel/sched/fair.c