sched/fair: correct task_fits_max() for misfit task

Function task_fits_max() checks if CPU maximum capacity can meet task
requirement. So it gets CPU capacity by using capacity_of(), this value
is CPU maximum capacity - bandwidth occupied by RT threads. So sometimes
capacity_of() is a bit less than CPU original capacity if the CPU has RT
threads on it. As an amendment for RT threads, function task_fits_max()
uses more flexible condition to check if the CPU can meet task
requirement, this is finished by below condition:

  if (capacity * capacity_margin > max_capacity * 1024)
		return true;

This condition introduces some unexpected result if the two clusters
have small difference so even the lower capacity cluster can easily
reach this criteria. So finally all CPUs can meet this condition and
is always invalid for misfit task checking..

This patch is to go back to use capacity_orig_of() to get CPU capacity
and if CPU is highest capacity CPU then always return true, otherwise it
will run detailed flow, this also includes the case when CPU has RT
threads on it.

Change-Id: Ice773b8bc4891887daa653e1ca26a1cb77d49630
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