sched/walt: avoid halted cpus for prev cpu fastpath

Currently walt_find_best_target can return a halted cpu.

Prevent the PREV_CPU_FASTPATH for cpus that are currently
halted, and reject them in general from being selected.

Change-Id: Iced61bf9b1355703c6403d1dc9f90d6e64aefdc6
Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
This commit is contained in:
Stephen Dickey 2021-12-15 13:39:38 -08:00 committed by Rishabh Bhatnagar
parent 79e3eab666
commit 7a3fe1d52e

View File

@ -270,7 +270,9 @@ static void walt_find_best_target(struct sched_domain *sd,
asym_cap_siblings(prev_cpu, start_cpu)) &&
cpu_active(prev_cpu) && cpu_online(prev_cpu) &&
available_idle_cpu(prev_cpu) &&
cpumask_test_cpu(prev_cpu, p->cpus_ptr)) {
cpumask_test_cpu(prev_cpu, p->cpus_ptr) &&
!cpu_halted(prev_cpu)) {
fbt_env->fastpath = PREV_CPU_FASTPATH;
cpumask_set_cpu(prev_cpu, candidates);
goto out;
@ -302,6 +304,9 @@ static void walt_find_best_target(struct sched_domain *sd,
if (!cpu_active(i))
continue;
if (cpu_halted(i))
continue;
if (active_candidate == -1)
active_candidate = i;