sched/fair: Make sure to try to detach at least one movable task
authorVincent Guittot <vincent.guittot@linaro.org>
Thu, 25 Aug 2022 12:27:23 +0000 (14:27 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 15 Sep 2022 14:13:51 +0000 (16:13 +0200)
commitb0defa7ae03ecf91b8bfd10ede430cff12fcbd06
treed590d068e868d7ce347e237d7e04095a65193388
parentfb04563d1cae6f361892b4a339ad92100b1eb0d0
sched/fair: Make sure to try to detach at least one movable task

During load balance, we try at most env->loop_max time to move a task.
But it can happen that the loop_max LRU tasks (ie tail of
the cfs_tasks list) can't be moved to dst_cpu because of affinity.
In this case, loop in the list until we found at least one.

The maximum of detached tasks remained the same as before.

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-2-vincent.guittot@linaro.org
kernel/sched/fair.c