• Paul Jackson's avatar
    [PATCH] Cpuset: fix ABBA deadlock with cpu hotplug lock · abb5a5cc
    Paul Jackson authored
    Fix ABBA deadlock between lock_cpu_hotplug() and the cpuset
    callback_mutex lock.
    
    It only happens on cpu_exclusive cpusets, due to the dynamic
    sched domain code trying to take the cpu hotplug lock inside
    the cpuset callback_mutex lock.
    
    This bug has apparently been here for several months, but didn't
    get hit until the right customer load on a large system.
    
    This fix appears right from inspection, but it will take a few
    more days running it on that customers workload to be confident
    we nailed it.  We don't have any other reproducible test case.
    
    The cpu_hotplug_lock() tends to cover large runs of code.
    The other places that hold both that lock and the cpuset callback
    mutex lock always nest the cpuset lock inside the hotplug lock.
    This place tries to do the reverse, risking an ABBA deadlock.
    
    This is in the cpuset_rmdir() code, where we:
      * take the callback_mutex lock
      * mark the cpuset CS_REMOVED
      * call update_cpu_domains for cpu_exclusive cpuset...
    abb5a5cc
cpuset.c 72.3 KB