]> Git Repo - linux.git/commitdiff
sched/fair: Move call to list_last_entry() in detach_tasks
authorVincent Guittot <[email protected]>
Thu, 25 Aug 2022 12:27:25 +0000 (14:27 +0200)
committerPeter Zijlstra <[email protected]>
Thu, 15 Sep 2022 14:13:52 +0000 (16:13 +0200)
Move the call to list_last_entry() in detach_tasks() after testing
loop_max and loop_break.

Signed-off-by: Vincent Guittot <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
kernel/sched/fair.c

index 7b3a58fcb4368ffc42fede52d4d04812c851b10c..5ffec43706023615686c11340177503d9710c0c1 100644 (file)
@@ -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;
 
This page took 0.08411 seconds and 4 git commands to generate.