From 97a7eb42925559b8b5b55e6fee65706e0aea4098 Mon Sep 17 00:00:00 2001 From: Abhijeet Dharmapurikar Date: Fri, 8 Apr 2022 16:01:56 -0700 Subject: [PATCH] sched/walt: fix incorrect migrations for RT task When a RT task is marked migration_disabled, i.e. its p->cpus_ptr points to a single cpu, walt_newidle_balance() could pull the task to an un-allowed cpu. To prevent that check p->cpus_ptr in addition to pick_highest_pushable_task(), as pick_highest_pushable_task() and pick_rt_task() only check for p->cpu_mask, which will be inaccurate in migration_disabled situation. Change-Id: If7b3cfcb357af7a3ff15de486e70b7b304e4f6ec Signed-off-by: Abhijeet Dharmapurikar Signed-off-by: Shaleen Agrawal --- kernel/sched/walt/walt_lb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/sched/walt/walt_lb.c b/kernel/sched/walt/walt_lb.c index ecc873d69a30..212247934c17 100644 --- a/kernel/sched/walt/walt_lb.c +++ b/kernel/sched/walt/walt_lb.c @@ -718,6 +718,9 @@ static bool walt_balance_rt(struct rq *this_rq) if (!p) goto unlock; + if (!cpumask_test_cpu(this_cpu, p->cpus_ptr)) + goto unlock; + wts = (struct walt_task_struct *) p->android_vendor_data1; /*