• Morten Rasmussen's avatar
    sched/fair: Consider misfit tasks when load-balancing · cad68e55
    Morten Rasmussen authored
    On asymmetric CPU capacity systems load intensive tasks can end up on
    CPUs that don't suit their compute demand.  In this scenarios 'misfit'
    tasks should be migrated to CPUs with higher compute capacity to ensure
    better throughput. group_misfit_task indicates this scenario, but tweaks
    to the load-balance code are needed to make the migrations happen.
    
    Misfit balancing only makes sense between a source group of lower
    per-CPU capacity and destination group of higher compute capacity.
    Otherwise, misfit balancing is ignored. group_misfit_task has lowest
    priority so any imbalance due to overload is dealt with first.
    
    The modifications are:
    
    1. Only pick a group containing misfit tasks as the busiest group if the
       destination group has higher capacity and has spare capacity.
    2. When the busiest group is a 'misfit' group, skip the usual average
       load and group capacity checks.
    3. Set the imbalance for 'misfit' balancing sufficiently high for a task
       to be pulled ignoring average load.
    4. Pick the CPU with the highest misfit load as the source CPU.
    5. If the misfit task is alone on the source CPU, go for active
       balancing.
    Signed-off-by: default avatarMorten Rasmussen <morten.rasmussen@arm.com>
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: dietmar.eggemann@arm.com
    Cc: gaku.inami.xh@renesas.com
    Cc: valentin.schneider@arm.com
    Cc: vincent.guittot@linaro.org
    Link: http://lkml.kernel.org/r/1530699470-29808-5-git-send-email-morten.rasmussen@arm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    cad68e55
fair.c 268 KB