rcu: Use RCU's online-CPU state for expedited IPI retry
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 30 Jun 2016 19:16:11 +0000 (12:16 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 22 Aug 2016 16:30:42 +0000 (09:30 -0700)
This commit improves the accuracy of the interaction between CPU hotplug
operations and RCU's expedited grace periods by using RCU's online-CPU
state to determine when failed IPIs should be retried.

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

index 3bc4b3d..24343eb 100644 (file)
@@ -385,17 +385,16 @@ retry_ipi:
                                mask_ofl_ipi &= ~mask;
                                continue;
                        }
-                       /* Failed, raced with offline. */
+                       /* Failed, raced with CPU hotplug operation. */
                        raw_spin_lock_irqsave_rcu_node(rnp, flags);
-                       if (cpu_online(cpu) &&
+                       if ((rnp->qsmaskinitnext & mask) &&
                            (rnp->expmask & mask)) {
+                               /* Online, so delay for a bit and try again. */
                                raw_spin_unlock_irqrestore_rcu_node(rnp, flags);
                                schedule_timeout_uninterruptible(1);
-                               if (cpu_online(cpu) &&
-                                   (rnp->expmask & mask))
-                                       goto retry_ipi;
-                               raw_spin_lock_irqsave_rcu_node(rnp, flags);
+                               goto retry_ipi;
                        }
+                       /* CPU really is offline, so we can ignore it. */
                        if (!(rnp->expmask & mask))
                                mask_ofl_ipi &= ~mask;
                        raw_spin_unlock_irqrestore_rcu_node(rnp, flags);