ANDROID: sched/rt: fix rt balance push

The commit : ANDROID: sched: Fix rt/dl load balancing via chain level balance
cause sched RT balance abnormal.

It uses affinity to CPU0 to determine whether an RT task can be pushed.
This resulting in RT tasks whose affinity does not
include CPU0 being unable to be balanced while sched_proxy_exec is not enabled..
Fix the __task_is_pushable return value(should be 1 or -1).

Bug: 423451285
Fixes: 9bad78b699 ("ANDROID: sched: Fix rt/dl load balancing via chain level balance")
Change-Id: I6c7b6c41e64b4a82435f3b9616db6383e1fc7740
Signed-off-by: kuyo chang <kuyo.chang@mediatek.com>
Signed-off-by: kuyo chang <kuyo.chang@mediatek.corp-partner.google.com>
This commit is contained in:
kuyo chang
2025-06-09 15:26:52 +08:00
committed by Treehugger Robot
parent bdad3fc9ed
commit c6e1897112

View File

@@ -3917,9 +3917,8 @@ void __move_queued_task_locked(struct rq *src_rq, struct rq *dst_rq, struct task
static inline
int __task_is_pushable(struct rq *rq, struct task_struct *p, int cpu)
{
if (!task_on_cpu(rq, p) &&
cpumask_test_cpu(cpu, &p->cpus_mask))
return 1;
if (!task_on_cpu(rq, p))
return cpumask_test_cpu(cpu, &p->cpus_mask) ? 1 : -1;
return 0;
}