diff options
author | Vincent Guittot <vincent.guittot@linaro.org> | 2022-08-25 14:27:25 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2022-09-15 16:13:52 +0200 |
commit | 7e9518baed4cef76dbfa07cbffbae1e6dbc87be6 (patch) | |
tree | 068e7c4f1c5b1f2c0bd706b986c641366a76d913 /kernel/sched | |
parent | c59862f8265f8060b6650ee1dc12159fe5c89779 (diff) |
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
Diffstat (limited to 'kernel/sched')
-rw-r--r-- | kernel/sched/fair.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 7b3a58fcb436..5ffec4370602 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -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; |