rcu: Exclude RCU-offline CPUs from expedited grace periods
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 30 Jun 2016 00:04:19 +0000 (17:04 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 22 Aug 2016 16:30:42 +0000 (09:30 -0700)
The expedited RCU grace periods currently rely on a failure indication
from smp_call_function_single() to determine that a given CPU is offline.
This works after a fashion, but is more contorted and less precise than
relying on RCU's internal state.  This commit therefore takes a first
step towards relying on internal state.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/tree_exp.h

index f316683..3bc4b3d 100644 (file)
@@ -359,7 +359,8 @@ static void sync_rcu_exp_select_cpus(struct rcu_state *rsp,
                        struct rcu_dynticks *rdtp = &per_cpu(rcu_dynticks, cpu);
 
                        if (raw_smp_processor_id() == cpu ||
-                           !(atomic_add_return(0, &rdtp->dynticks) & 0x1))
+                           !(atomic_add_return(0, &rdtp->dynticks) & 0x1) ||
+                           !(rnp->qsmaskinitnext & rdp->grpmask))
                                mask_ofl_test |= rdp->grpmask;
                }
                mask_ofl_ipi = rnp->expmask & ~mask_ofl_test;