sched/fair: fix for group_smaller_cpu_capacity()

Function group_smaller_cpu_capacity() checks if one schedule group has
smaller capacity than another one:

return sg->sgc->max_capacity + capacity_margin - SCHED_LOAD_SCALE <
					ref->sgc->max_capacity;

The value (capacity_margin - SCHED_LOAD_SCALE) is an absolute value for
difference checking, so it's easily broken if two scheduler groups have
no much difference (like CA53.Fast+CA53.Slow system).

When this function is invalid the schedule group with misfit tasks
will be wrongly cleared flag so misfit task has no chance to migrate to
higher capacity CPU.

This patch is to directly check schedule group maximum_capacity and has
a minor fix for maximum_capacity assignment with original capacity.

Change-Id: I8071f2ee90e0823c3232018bdbf27e759fba0ec1
Signed-off-by: Leo Yan <leo.yan@linaro.org>
Patch-mainline: eas-dev @ 12/22/16, 15:58
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
1 file changed