• Paul E. McKenney's avatar
    rcu: Make rcu_start_future_gp()'s grace-period check more precise · 825a9911
    Paul E. McKenney authored
    The rcu_start_future_gp() function uses a sloppy check for a grace
    period being in progress, which works today because there are a number
    of code sequences that resolve the resulting races.  However, some of
    these race-resolution code sequences must acquire the root rcu_node
    structure's ->lock, and contention on that lock has started manifesting.
    This commit therefore makes rcu_start_future_gp() check more precise,
    eliminating the sloppy lockless check of the rcu_state structure's ->gpnum
    and ->completed fields.  The effect is that rcu_start_future_gp() will
    sometimes unnecessarily attempt to start a new grace period, but this
    overhead will be reduced later using funnel locking.
    Reported-by: default avatarNicholas Piggin <npiggin@gmail.com>
    Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
    Tested-by: default avatarNicholas Piggin <npiggin@gmail.com>
    825a9911
tree.c 131 KB