sched/walt: skip enery evaluation for need_idle when idle CPU is available

When need_idle flag is set & lower capacity CPU is idle, there is no need
to go for energy evaluation with higher capacity CPUs. Placement code used
to skip energy evaluation in previous Kernels, this commit matches the
need_idle functionality of previous Kernels.

Change-Id: Ib21baa2b99e882e27550894ef814ed7114d01e8c
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
This commit is contained in:
Satya Durga Srinivasu Prabhala 2021-07-26 04:55:45 -07:00 committed by Rishabh Bhatnagar
parent 2dd3a6b665
commit 58862813fa

View File

@ -755,6 +755,11 @@ int walt_find_energy_efficient_cpu(struct task_struct *p, int prev_cpu,
}
}
if (need_idle && available_idle_cpu(max_cap_cpu)) {
best_energy_cpu = max_cap_cpu;
goto unlock;
}
for_each_cpu(cpu, candidates) {
if (capacity_orig_of(max_cap_cpu) < capacity_orig_of(cpu))
max_cap_cpu = cpu;