• Christoph Lameter's avatar
    Fix longstanding load balancing bug in the scheduler · ef147950
    Christoph Lameter authored
    The scheduler will stop load balancing if the most busy processor contains
    processes pinned via processor affinity.
    
    The scheduler currently only does one search for busiest cpu.  If it cannot
    pull any tasks away from the busiest cpu because they were pinned then the
    scheduler goes into a corner and sulks leaving the idle processors idle.
    
    F.e.  If you have processor 0 busy running four tasks pinned via taskset,
    there are none on processor 1 and one just started two processes on
    processor 2 then the scheduler will not move one of the two processes away
    from processor 2.
    
    This patch fixes that issue by forcing the scheduler to come out of its
    corner and retrying the load balancing by considering other processors for
    load balancing.
    
    This patch was originally developed by John Hawkes and discussed at
    
        http://marc.theaimsgroup.com/?l=linux-kernel&m=113901368523205&w=2.
    
    I have removed extraneous material and gone back to equipping struct rq
    with the cp...
    ef147950
sched.c 153 KB