• Rik van Riel's avatar
    sched/fair: Make update_sd_pick_busiest() return 'true' on a busier sd · caeb178c
    Rik van Riel authored
    Currently update_sd_pick_busiest only identifies the busiest sd
    that is either overloaded, or has a group imbalance. When no
    sd is imbalanced or overloaded, the load balancer fails to find
    the busiest domain.
    
    This breaks load balancing between domains that are not overloaded,
    in the !SD_ASYM_PACKING case. This patch makes update_sd_pick_busiest
    return true when the busiest sd yet is encountered.
    
    Groups are ranked in the order overloaded > imbalanced > other,
    with higher ranked groups getting priority even when their load
    is lower. This is necessary due to the possibility of unequal
    capacities and cpumasks between domains within a sched group.
    
    Behaviour for SD_ASYM_PACKING does not seem to match the comment,
    but I have no hardware to test that so I have left the behaviour
    of that code unchanged.
    
    Enum for group classification suggested by Peter Zijlstra.
    Signed-off-by: default avatarRik van Riel <riel@redhat.com>
    [peterz: replaced sg_lb_stats::group_imb with the new enum group_type
             in an attempt to avoid endless recalculation]
    Signed-off-by: default avatarPeter Zijlstra <peterz@infradead.org>
    Acked-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
    Acked-by: default avatarMichael Neuling <mikey@neuling.org>
    Cc: ktkhai@parallels.com
    Cc: tim.c.chen@linux.intel.com
    Cc: nicolas.pitre@linaro.org
    Cc: jhladky@redhat.com
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Link: http://lkml.kernel.org/r/20140729152743.GI3935@laptopSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    caeb178c
fair.c 204 KB