aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2010-03-19 00:36:51 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2010-05-10 14:08:31 -0400
commitd25eb9442bb2c38c1e742f0fa764d7132d72593f (patch)
tree0a2604a3b61ce7a0868c021ac945d9826e0d88f1 /kernel/rcutree.c
parent2b3fc35f6919344e3cf722dde8308f47235c0b70 (diff)
rcu: substitute set_need_resched for sending resched IPIs
This patch adds a check to __rcu_pending() that does a local set_need_resched() if the current CPU is holding up the current grace period and if force_quiescent_state() will be called soon. The goal is to reduce the probability that force_quiescent_state() will need to do smp_send_reschedule(), which sends an IPI and is therefore more expensive on most architectures. Signed-off-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r--kernel/rcutree.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 3ec8160fc75..e54c1235122 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -1499,6 +1499,16 @@ static int __rcu_pending(struct rcu_state *rsp, struct rcu_data *rdp)
1499 1499
1500 /* Is the RCU core waiting for a quiescent state from this CPU? */ 1500 /* Is the RCU core waiting for a quiescent state from this CPU? */
1501 if (rdp->qs_pending) { 1501 if (rdp->qs_pending) {
1502
1503 /*
1504 * If force_quiescent_state() coming soon and this CPU
1505 * needs a quiescent state, and this is either RCU-sched
1506 * or RCU-bh, force a local reschedule.
1507 */
1508 if (!rdp->preemptable &&
1509 ULONG_CMP_LT(ACCESS_ONCE(rsp->jiffies_force_qs) - 1,
1510 jiffies))
1511 set_need_resched();
1502 rdp->n_rp_qs_pending++; 1512 rdp->n_rp_qs_pending++;
1503 return 1; 1513 return 1;
1504 } 1514 }