* [PATCH] Fix rcutree grace-period-latency bug on small systems
@ 2009-01-05 4:30 Paul E. McKenney
2009-01-05 5:05 ` Andi Kleen
2009-01-05 9:10 ` Ingo Molnar
0 siblings, 2 replies; 3+ messages in thread
From: Paul E. McKenney @ 2009-01-05 4:30 UTC (permalink / raw)
To: linux-kernel; +Cc: mingo, andi, snakebyte, akpm, dvhltc, niv, manfred, laijs
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.
Located-by: Andi Kleen <andi@firstfloor.org>
Tested-by: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
rcutree.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index a342b03..88d921c 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -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;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix rcutree grace-period-latency bug on small systems
2009-01-05 4:30 [PATCH] Fix rcutree grace-period-latency bug on small systems Paul E. McKenney
@ 2009-01-05 5:05 ` Andi Kleen
2009-01-05 9:10 ` Ingo Molnar
1 sibling, 0 replies; 3+ messages in thread
From: Andi Kleen @ 2009-01-05 5:05 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, mingo, andi, snakebyte, akpm, dvhltc, niv, manfred,
laijs
> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix rcutree grace-period-latency bug on small systems
2009-01-05 4:30 [PATCH] Fix rcutree grace-period-latency bug on small systems Paul E. McKenney
2009-01-05 5:05 ` Andi Kleen
@ 2009-01-05 9:10 ` Ingo Molnar
1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2009-01-05 9:10 UTC (permalink / raw)
To: Paul E. McKenney
Cc: linux-kernel, andi, snakebyte, akpm, dvhltc, niv, manfred, laijs
* Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
> 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.
>
> Located-by: Andi Kleen <andi@firstfloor.org>
> Tested-by: Andi Kleen <andi@firstfloor.org>
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> ---
>
> rcutree.c | 1 +
> 1 file changed, 1 insertion(+)
Applied to tip/core/urgent, thanks guys!
Ingo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-05 9:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-05 4:30 [PATCH] Fix rcutree grace-period-latency bug on small systems Paul E. McKenney
2009-01-05 5:05 ` Andi Kleen
2009-01-05 9:10 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox