From 90282ad0036835e026d878b6322d8520c8ce7004 Mon Sep 17 00:00:00 2001 From: "Paul E. McKenney" Date: Fri, 10 Dec 2010 15:02:47 -0800 Subject: [PATCH] --- yaml --- r: 223807 b: refs/heads/master c: 121dfc4b3eba9e2f3c42d35205a3510cc65b9931 h: refs/heads/master i: 223805: 3fa5a8ca38a0f0dd533a7eed4f5171d58eadd09b 223803: ff5a9e3a30811854936d2956ce99cd799b5be86c 223799: 30bd036733ad1e0fa3477ba661a0e18041d4211d 223791: 8aacfdcd71251504e15049d707e43657fff410e9 223775: b4bbc421171321cbd27ceefe56d6b0f654f44b57 223743: 63afd0d8de012fe33e9b9bfe9a7264d17a5abe23 v: v3 --- [refs] | 2 +- trunk/kernel/rcutree.c | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 3e320e37dc34..5ebcc6636dc0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5ff8e6f0535fe730e921ca347bc38dcb9e01791a +refs/heads/master: 121dfc4b3eba9e2f3c42d35205a3510cc65b9931 diff --git a/trunk/kernel/rcutree.c b/trunk/kernel/rcutree.c index 8105271fc10e..c39ec5b4ae82 100644 --- a/trunk/kernel/rcutree.c +++ b/trunk/kernel/rcutree.c @@ -617,9 +617,17 @@ static void __init check_cpu_stall_init(void) static void __note_new_gpnum(struct rcu_state *rsp, struct rcu_node *rnp, struct rcu_data *rdp) { if (rdp->gpnum != rnp->gpnum) { - rdp->qs_pending = 1; - rdp->passed_quiesc = 0; + /* + * If the current grace period is waiting for this CPU, + * set up to detect a quiescent state, otherwise don't + * go looking for one. + */ rdp->gpnum = rnp->gpnum; + if (rnp->qsmask & rdp->grpmask) { + rdp->qs_pending = 1; + rdp->passed_quiesc = 0; + } else + rdp->qs_pending = 0; } } @@ -681,19 +689,20 @@ __rcu_process_gp_end(struct rcu_state *rsp, struct rcu_node *rnp, struct rcu_dat /* * If we were in an extended quiescent state, we may have - * missed some grace periods that others CPUs took care on + * missed some grace periods that others CPUs handled on * our behalf. Catch up with this state to avoid noting - * spurious new grace periods. + * spurious new grace periods. If another grace period + * has started, then rnp->gpnum will have advanced, so + * we will detect this later on. */ - if (rdp->completed > rdp->gpnum) + if (ULONG_CMP_LT(rdp->gpnum, rdp->completed)) rdp->gpnum = rdp->completed; /* - * If another CPU handled our extended quiescent states and - * we have no more grace period to complete yet, then stop - * chasing quiescent states. + * If RCU does not need a quiescent state from this CPU, + * then make sure that this CPU doesn't go looking for one. */ - if (rdp->completed == rnp->gpnum) + if ((rnp->qsmask & rdp->grpmask) == 0) rdp->qs_pending = 0; } }