• Darren Hart's avatar
    [PATCH] sched: active_load_balance fixes · 94fe0f3e
    Darren Hart authored
    The following patch against the latest mm fixes several problems with
    active_load_balance().
    
    Rather than starting with the highest allowable domain (SD_LOAD_BALANCE is
    still set) and depending on the order of the cpu groups, we start at the
    lowest domain and work up until we find a suitable CPU or run out of
    options (SD_LOAD_BALANCE is no longer set).  This is a more robust approach
    as it is more explicit and not subject to the construction order of the cpu
    groups.
    
    We move the test for busiest_rq->nr_running <=1 into the domain loop so we
    don't continue to try and move tasks when there are none left to move.
    This new logic (testing for nr_running in the domain loop) should make the
    busiest_rq==target_rq condition really impossible, so we have replaced the
    graceful continue on fail with a BUG_ON.  (Bjorn Helgaas, please confirm)
    
    We eliminate the exclusion of the busiest_cpu's group from the pool of
    available groups to push to as it is the ideal group to push to, even if
    not very likely to be available.  Note that by removing the test for
    group==busy_group and allowing it to also be tested for suitability, the
    running time is nearly the same.
    
    We no longer force the destination CPU to be in a group of completely idle
    CPUs, nor to be the last in that group.
    Signed-off-by: default avatarDarren Hart <dvhltc@us.ibm.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    94fe0f3e
sched.c 114 KB