Skip to contentSkip to conversation

Fix rcutree grace-period-latency bug on small systems

PATCH Applied Paul E. McKenney 3 participants 3 messages Jan 5, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix rcutree grace-period-latency bug on small systems

Kudos to Andi Kleen for finding a grace-period-latency problem! The problem was that the special-case code for small machines never updated the ->signaled field to indicate that grace-period initialization had completed, which prevented force_quiescent_state() from ever expediting grace periods. This problem resulted in grace periods extending for more than 20 seconds. Not subtle. I introduced this bug during my inspection process when I fixed a race between grace-period initialization and force_quiescent_state() execution.

The following patch properly updates the ->signaled field for the "small"-system case (no more than 32 CPUs for 32-bit kernels and no more than 64 CPUs for 64-bit kernels).

I believe that this patch should be included for 2.6.29.

---

 rcutree.c |    1 +
 1 file changed, 1 insertion(+)
kernel/rcutree.c +1 -0
index a342b03..88d921c 100644
@@ -572,6 +572,7 @@ rcu_start_gp(struct rcu_state *rsp, unsigned long flags)
 	/* Special-case the common single-level case. */
 	if (NUM_RCU_NODES == 1) {
 		rnp->qsmask = rnp->qsmaskinit;
+		rsp->signaled = RCU_SIGNAL_INIT; /* force_quiescent_state OK. */
 		spin_unlock_irqrestore(&rnp->lock, flags);
 		return;
 	}
#1 lore raw
Quoted 5 lines

The following patch properly updates the ->signaled field for the "small"-system case (no more than 32 CPUs for 32-bit kernels and no more than 64 CPUs for 64-bit kernels).

I believe that this patch should be included for 2.6.29.

Yes, it's really needed. One of my test system takes forever to boot without it when tree rcu is enabled.

Thanks Paul for the debugging work.

-Andi

Applied
#2 lore raw
In reply to Paul E. McKenney
Quoted 15 lines · Paul E. McKenney

Kudos to Andi Kleen for finding a grace-period-latency problem! The problem was that the special-case code for small machines never updated the ->signaled field to indicate that grace-period initialization had completed, which prevented force_quiescent_state() from ever expediting grace periods. This problem resulted in grace periods extending for more than 20 seconds. Not subtle. I introduced this bug during my inspection process when I fixed a race between grace-period initialization and force_quiescent_state() execution.

The following patch properly updates the ->signaled field for the "small"-system case (no more than 32 CPUs for 32-bit kernels and no more than 64 CPUs for 64-bit kernels).

I believe that this patch should be included for 2.6.29.

Quoted 7 lines

---

 rcutree.c |    1 +
 1 file changed, 1 insertion(+)

Applied to tip/core/urgent, thanks guys!

Ingo