From c565963618c0a3941778bb99e641ad483a7a7e24 Mon Sep 17 00:00:00 2001 From: Abhijeet Dharmapurikar Date: Wed, 12 May 2021 12:17:57 -0700 Subject: [PATCH] walt: honor affinity in placement path Walt placement code could return the prev_cpu for placement without checking if it is in affinity mask. Fix it by checking task's cpus_ptr. Change-Id: I6edf2249bccffd1868dd546dc18b45af311cc91d Signed-off-by: Abhijeet Dharmapurikar --- kernel/sched/walt/walt_cfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/walt/walt_cfs.c b/kernel/sched/walt/walt_cfs.c index 7b424d3b1d43..990fe008a9d5 100644 --- a/kernel/sched/walt/walt_cfs.c +++ b/kernel/sched/walt/walt_cfs.c @@ -200,7 +200,8 @@ static void walt_find_best_target(struct sched_domain *sd, if (((capacity_orig_of(prev_cpu) == capacity_orig_of(start_cpu)) || asym_cap_siblings(prev_cpu, start_cpu)) && cpu_active(prev_cpu) && cpu_online(prev_cpu) && - available_idle_cpu(prev_cpu)) { + available_idle_cpu(prev_cpu) && + cpumask_test_cpu(prev_cpu, p->cpus_ptr)) { target_cpu = prev_cpu; fbt_env->fastpath = PREV_CPU_FASTPATH; cpumask_set_cpu(target_cpu, candidates);