Function bind_best_target() tries to find maximum spare capacity CPU, this is finished by finding max(capacity_orig_of(cpu) - new_util). The value 'new_util' has different meaning for PELT signal and WALT signal, for WALT signal it has includes RT pressure but PELT has missed RT pressure.
This commit is to fix up 'new_util' to include RT pressure, we can achieve this by using function __cpu_util_sum() to accumulate RT utilization for PELT signal, and this function directly returns back 'new_util' value so avoid to accumulate RT pressure twice.
Signed-off-by: Leo Yan leo.yan@linaro.org --- kernel/sched/fair.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 4b17a08..1ce700a 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6700,6 +6700,7 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu, * accounting. However, the blocked utilization may be zero. */ wake_util = cpu_util_wake(i, p); + wake_util = __cpu_util_sum(i, cpu_rq(i)->rt.avg.util_avg, wake_util); new_util = wake_util + task_util_est(p);
/* -- 1.9.1