• Peter Williams's avatar
    [PATCH] sched: modify move_tasks() to improve load balancing outcomes · 50ddd969
    Peter Williams authored
    Problem:
    
    The move_tasks() function is designed to move UP TO the amount of load it
    is asked to move and in doing this it skips over tasks looking for ones
    whose load weights are less than or equal to the remaining load to be
    moved.  This is (in general) a good thing but it has the unfortunate result
    of breaking one of the original load balancer's good points: namely, that
    (within the limits imposed by the active/expired array model and the fact
    the expired is processed first) it moves high priority tasks before low
    priority ones and this means there's a good chance (see active/expired
    problem for why it's only a chance) that the highest priority task on the
    queue but not actually on the CPU will be moved to the other CPU where (as
    a high priority task) it may preempt the current task.
    
    Solution:
    
    Modify move_tasks() so that high priority tasks are not skipped when moving
    them will make them the highest priority task on their new run queue.
    Signed-off-by: default avatarPeter Williams <pwil3058@bigpond.com.au>
    Cc: Ingo Molnar <mingo@elte.hu>
    Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
    Cc: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    50ddd969
sched.c 159 KB