mirror of
https://github.com/torvalds/linux.git
synced 2026-08-01 03:59:40 +02:00
sched/walt: Fix excess detach_task in walt_lb_pull_tasks
There's three loops to find a task to pull. In the first iteration, we look for a task that is not running, which fits a strict criteria. In the second iteration, we look for a task that is not running, which fits a lax criteria. If we have still not found a valid task to pull, we intended to pull the running task servicing an active load migration. However, there is some leftover code, wherein a task that is not running will end up being detached and pulled. This was not intended, and leads to incorrect behavior. Essentially, this is negating the effects of the first two iterations. Change-Id: Ia225d89043c76ec6e661771a39d058498346920d Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
This commit is contained in:
parent
b18d15cb16
commit
f41f3a4e0c
|
|
@ -341,11 +341,9 @@ static int walt_lb_pull_tasks(int dst_cpu, int src_cpu)
|
|||
|
||||
list_for_each_entry_reverse(p, &src_rq->cfs_tasks, se.group_node) {
|
||||
|
||||
if (!cpumask_test_cpu(dst_cpu, p->cpus_ptr))
|
||||
continue;
|
||||
|
||||
if (task_running(src_rq, p)) {
|
||||
if (need_active_lb(p, dst_cpu, src_cpu)) {
|
||||
if (cpumask_test_cpu(dst_cpu, p->cpus_ptr)
|
||||
&& need_active_lb(p, dst_cpu, src_cpu)) {
|
||||
bool success;
|
||||
active_balance = true;
|
||||
src_rq->active_balance = 1;
|
||||
|
|
@ -371,12 +369,8 @@ static int walt_lb_pull_tasks(int dst_cpu, int src_cpu)
|
|||
|
||||
return 0; /* we did not pull any task here */
|
||||
}
|
||||
continue;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
walt_detach_task(p, src_rq, dst_rq);
|
||||
pulled_task = p;
|
||||
goto unlock;
|
||||
}
|
||||
unlock:
|
||||
/* lock must be dropped before waking the stopper */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user