Skip to content

Commit 7e9518b

Browse files
vingu-linaroPeter Zijlstra
authored andcommitted
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: Vincent Guittot <vincent.guittot@linaro.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20220825122726.20819-4-vincent.guittot@linaro.org
1 parent c59862f commit 7e9518b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/sched/fair.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8044,8 +8044,6 @@ static int detach_tasks(struct lb_env *env)
80448044
if (env->idle != CPU_NOT_IDLE && env->src_rq->nr_running <= 1)
80458045
break;
80468046

8047-
p = list_last_entry(tasks, struct task_struct, se.group_node);
8048-
80498047
env->loop++;
80508048
/*
80518049
* 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)
80628060
break;
80638061
}
80648062

8063+
p = list_last_entry(tasks, struct task_struct, se.group_node);
8064+
80658065
if (!can_migrate_task(p, env))
80668066
goto next;
80678067

0 commit comments

Comments
 (0)