Commit 7e9518ba authored by Vincent Guittot's avatar Vincent Guittot Committed by Peter Zijlstra

sched/fair: Move call to list_last_entry() in detach_tasks

Move the call to list_last_entry() in detach_tasks() after testing
loop_max and loop_break.
Signed-off-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20220825122726.20819-4-vincent.guittot@linaro.org
parent c59862f8
......@@ -8044,8 +8044,6 @@ static int detach_tasks(struct lb_env *env)
if (env->idle != CPU_NOT_IDLE && env->src_rq->nr_running <= 1)
break;
p = list_last_entry(tasks, struct task_struct, se.group_node);
env->loop++;
/*
* We've more or less seen every task there is, call it quits
......@@ -8062,6 +8060,8 @@ static int detach_tasks(struct lb_env *env)
break;
}
p = list_last_entry(tasks, struct task_struct, se.group_node);
if (!can_migrate_task(p, env))
goto next;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment