From 58862813fa7989abc826e2c8d386064e863a0166 Mon Sep 17 00:00:00 2001 From: Satya Durga Srinivasu Prabhala Date: Mon, 26 Jul 2021 04:55:45 -0700 Subject: [PATCH] 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 --- kernel/sched/walt/walt_cfs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/sched/walt/walt_cfs.c b/kernel/sched/walt/walt_cfs.c index 49918071d936..f481948772e2 100644 --- a/kernel/sched/walt/walt_cfs.c +++ b/kernel/sched/walt/walt_cfs.c @@ -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;