• Vincent Guittot's avatar
    sched/cfs: fix spurious active migration · 6cf82d55
    Vincent Guittot authored
    The load balance can fail to find a suitable task during the periodic check
    because  the imbalance is smaller than half of the load of the waiting
    tasks. This results in the increase of the number of failed load balance,
    which can end up to start an active migration. This active migration is
    useless because the current running task is not a better choice than the
    waiting ones. In fact, the current task was probably not running but
    waiting for the CPU during one of the previous attempts and it had already
    not been selected.
    
    When load balance fails too many times to migrate a task, we should relax
    the contraint on the maximum load of the tasks that can be migrated
    similarly to what is done with cache hotness.
    
    Before the rework, load balance used to set the imbalance to the average
    load_per_task in order to mitigate such situation. This increased the
    likelihood of migrating a task but also of selecting a larger task than
    needed while more appropriate ones were in the list.
    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/1575036287-6052-1-git-send-email-vincent.guittot@linaro.org
    6cf82d55
fair.c 286 KB