• Peter Zijlstra's avatar
    sched: Fix cgroup smp fairness · a5004278
    Peter Zijlstra authored
    Commit ec4e0e2f ("fix
    inconsistency when redistribute per-cpu tg->cfs_rq shares")
    broke cgroup smp fairness.
    
    In order to avoid starvation of newly placed tasks, we never
    quite set the share of an empty cpu group-task to 0, but
    instead we set it as if there's a single NICE-0 task present.
    
    If however we actually set this in cfs_rq[cpu]->shares, that
    means the total shares for that group will be slightly inflated
    every time we balance, causing the observed unfairness.
    
    Fix this by setting cfs_rq[cpu]->shares to 0 but actually
    setting the effective weight of the related se to the inflated
    number.
    Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
    LKML-Reference: <1248696557.6987.1615.camel@twins>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    a5004278
sched.c 260 KB