sched/fair: Fix excessive packing on the max capacity CPU

When boost is enabled or mid capacity cluster has single cpu, then
we traverse both mid and max capacity CPUs. When all of these CPUs
are busy, the task should be placed on the CPU which has highest
spare capacity. However the current code completely ignores
the mid capacity CPU when it encounters the max capacity CPU,
though the former has more spare capacity.

Fix this issue by enforcing the spare capacity check across
different capacity CPUs.

Change-Id: I726d47f985f9e59d2bb1c6cf2b743796b57e3051
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This commit is contained in:
Lingutla Chandrasekhar 2022-01-14 15:33:12 +01:00 committed by Richard Raya
parent 49caeb1ddc
commit d074e18d7d

View File

@ -7901,8 +7901,7 @@ static inline int find_best_target(struct task_struct *p, int *backup_cpu,
active_cpus_count++;
/* Favor CPUs with maximum spare capacity */
if (capacity_orig >= target_capacity &&
spare_cap < target_max_spare_cap)
if (spare_cap < target_max_spare_cap)
continue;
target_max_spare_cap = spare_cap;