summaryrefslogtreecommitdiff
path: root/kernel/rcupdate.c
diff options
context:
space:
mode:
authorManfred Spraul <manfred@colorfullife.com>2005-01-04 05:31:02 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-01-04 05:31:02 -0800
commit17b3fed12daae4af3b970beac31a182dc6cee044 (patch)
treefe7f40fde16aa74c85a512bf9e789b49e44a5735 /kernel/rcupdate.c
parent2f803905de112869f6f45ba52bd266254053a912 (diff)
[PATCH] rcu: simplify quiescent state detection
Based on an initial patch from Oleg Nesterov <oleg@tv-sign.ru> rcu_data.last_qsctr is not needed. Actually, not even a counter is needed, just a flag that indicates that there was a quiescent state. Signed-Off-By: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/rcupdate.c')
-rw-r--r--kernel/rcupdate.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index ebe7e5d96b35..f0ae3c3c013e 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -219,9 +219,9 @@ static void rcu_check_quiescent_state(struct rcu_ctrlblk *rcp,
struct rcu_state *rsp, struct rcu_data *rdp)
{
if (rdp->quiescbatch != rcp->cur) {
- /* new grace period: record qsctr value. */
+ /* start new grace period: */
rdp->qs_pending = 1;
- rdp->last_qsctr = rdp->qsctr;
+ rdp->passed_quiesc = 0;
rdp->quiescbatch = rcp->cur;
return;
}
@@ -234,11 +234,10 @@ static void rcu_check_quiescent_state(struct rcu_ctrlblk *rcp,
return;
/*
- * Races with local timer interrupt - in the worst case
- * we may miss one quiescent state of that CPU. That is
- * tolerable. So no need to disable interrupts.
+ * Was there a quiescent state since the beginning of the grace
+ * period? If no, then exit and wait for the next call.
*/
- if (rdp->qsctr == rdp->last_qsctr)
+ if (!rdp->passed_quiesc)
return;
rdp->qs_pending = 0;