• Vincent Guittot's avatar
    sched/fair: Fix rework of find_idlest_group() · 3318544b
    Vincent Guittot authored
    The task, for which the scheduler looks for the idlest group of CPUs, must
    be discounted from all statistics in order to get a fair comparison
    between groups. This includes utilization, load, nr_running and idle_cpus.
    
    Such unfairness can be easily highlighted with the unixbench execl 1 task.
    This test continuously call execve() and the scheduler looks for the idlest
    group/CPU on which it should place the task. Because the task runs on the
    local group/CPU, the latter seems already busy even if there is nothing
    else running on it. As a result, the scheduler will always select another
    group/CPU than the local one.
    
    This recovers most of the performance regression on my system from the
    recent load-balancer rewrite.
    
    [ mingo: Minor cleanups. ]
    Reported-by: default avatarkernel test robot <rong.a.chen@intel.com>
    Tested-by: default avatarkernel test robot <rong.a.chen@intel.com>
    Signed-off-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Morten.Rasmussen@arm.com
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: dietmar.eggemann@arm.com
    Cc: hdanton@sina.com
    Cc: parth@linux.ibm.com
    Cc: pauld@redhat.com
    Cc: quentin.perret@arm.com
    Cc: riel@surriel.com
    Cc: srikar@linux.vnet.ibm.com
    Cc: valentin.schneider@arm.com
    Fixes: 57abff06 ("sched/fair: Rework find_idlest_group()")
    Link: https://lkml.kernel.org/r/1571762798-25900-1-git-send-email-vincent.guittot@linaro.orgSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    3318544b
fair.c 285 KB