From 7a3fe1d52e04387f9286eb17574c98acca10da1e Mon Sep 17 00:00:00 2001 From: Stephen Dickey Date: Wed, 15 Dec 2021 13:39:38 -0800 Subject: [PATCH] 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 --- kernel/sched/walt/walt_cfs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/sched/walt/walt_cfs.c b/kernel/sched/walt/walt_cfs.c index 61e63238e1e6..798506277076 100644 --- a/kernel/sched/walt/walt_cfs.c +++ b/kernel/sched/walt/walt_cfs.c @@ -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;