• Dinakar Guniguntala's avatar
    sched: Fix dynamic power-balancing crash · 465a3c40
    Dinakar Guniguntala authored
    This crash:
        
    [ 1774.088275] divide error: 0000 [#1] SMP
    [ 1774.100355] CPU 13
    [ 1774.102498] Modules linked in:
    [ 1774.105631] Pid: 30881, comm: hackbench Not tainted 2.6.31-rc8-tip-01308-g484d664-dirty #1629 X8DTN
    [ 1774.114807] RIP: 0010:[<ffffffff81041c38>]  [<ffffffff81041c38>]
    sched_balance_self+0x19b/0x2d4
        
    Triggers because update_group_power() modifies the sd tree and does
    temporary calculations there - not considering that other CPUs
    could observe intermediate values, such as the zero initial value.
        
    Calculate it in a temporary variable instead. (we need no memory
    barrier as these are all statistical values anyway)
        
    Got the same oops with the backport to -rt
    Signed-off-by: default avatarDinakar Guniguntala <dino@in.ibm.com>
    Cc: John Stultz <johnstul@us.ibm.com>
    Cc: Darren Hart <dvhltc@us.ibm.com>
    Cc: John Kacur <jkacur@redhat.com>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    465a3c40
sched.c 271 KB