From 324d02c0c5fa50a420b165e43b74c0be34524957 Mon Sep 17 00:00:00 2001 From: Stephen Dickey Date: Wed, 15 Dec 2021 13:27:40 -0800 Subject: [PATCH] sched/walt: avoid halted cpus in walt_find_energy_efficient_cpu select_task_rq_fair invokes the select_task_rq_fair hook, which ultimately invokes walt_find_energy_aware_cpu for cfs tasks. This can return a cpu that is halted. Update the one remaining case that can cause feec to return a halted cpu. Change-Id: Ic97345764ad8be1060868414869dc0e455f4bc54 Signed-off-by: Stephen Dickey --- kernel/sched/walt/walt_cfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/walt/walt_cfs.c b/kernel/sched/walt/walt_cfs.c index 798506277076..f90befa107c6 100644 --- a/kernel/sched/walt/walt_cfs.c +++ b/kernel/sched/walt/walt_cfs.c @@ -788,8 +788,8 @@ int walt_find_energy_efficient_cpu(struct task_struct *p, int prev_cpu, if (sync && (need_idle || (is_rtg && curr_is_rtg))) sync = 0; - if (sysctl_sched_sync_hint_enable && sync - && bias_to_this_cpu(p, cpu, start_cpu)) { + if (sysctl_sched_sync_hint_enable && sync && + bias_to_this_cpu(p, cpu, start_cpu) && !cpu_halted(cpu)) { best_energy_cpu = cpu; fbt_env.fastpath = SYNC_WAKEUP; goto done;