• Boqun Feng's avatar
    rcu: Make expedited GPs handle CPU 0 being offline · fcc63543
    Boqun Feng authored
    Currently, the parallelized initialization of expedited grace periods uses
    the workqueue associated with each rcu_node structure's ->grplo field.
    This works fine unless that CPU is offline.  This commit therefore uses
    the CPU corresponding to the lowest-numbered online CPU, or just queues
    the work on WORK_CPU_UNBOUND if there are no online CPUs corresponding
    to this rcu_node structure.
    
    Note that this patch uses cpu_is_offline() instead of the usual approach
    of checking bits in the rcu_node structure's ->qsmaskinitnext field.  This
    is safe because preemption is disabled across both the cpu_is_offline()
    check and the call to queue_work_on().
    Signed-off-by: default avatarBoqun Feng <boqun.feng@gmail.com>
    [ paulmck: Disable preemption to close offline race window. ]
    Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
    [ paulmck: Apply Peter Zijlstra feedback on CPU selection. ]
    Tested-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
    fcc63543
tree_exp.h 24.6 KB