From: Oleg Nesterov <oleg@tv-sign.ru>

last_qsctr is used in rcu_check_quiescent_state() exclusively.
We can reset qsctr at the start of the grace period, and then
just test qsctr against 0.

It is safe because the whole rcu_data is cpu-local, and local
timer interrupt checks in_softirq() before incrementing ->qsctr.

Also, removes stale comment in rcu_check_quiescent_state().

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/include/linux/rcupdate.h |    2 --
 25-akpm/kernel/rcupdate.c        |   11 +++--------
 2 files changed, 3 insertions(+), 10 deletions(-)

diff -puN include/linux/rcupdate.h~rcu-eliminate-rcu_datalast_qsctr include/linux/rcupdate.h
--- 25/include/linux/rcupdate.h~rcu-eliminate-rcu_datalast_qsctr	Mon Nov 29 13:05:54 2004
+++ 25-akpm/include/linux/rcupdate.h	Mon Nov 29 13:05:54 2004
@@ -88,8 +88,6 @@ struct rcu_data {
 	/* 1) quiescent state handling : */
 	long		quiescbatch;     /* Batch # for grace period */
 	long		qsctr;		 /* User-mode/idle loop etc. */
-	long            last_qsctr;	 /* value of qsctr at beginning */
-					 /* of rcu grace period */
 	int		qs_pending;	 /* core waits for quiesc state */
 
 	/* 2) batch handling */
diff -puN kernel/rcupdate.c~rcu-eliminate-rcu_datalast_qsctr kernel/rcupdate.c
--- 25/kernel/rcupdate.c~rcu-eliminate-rcu_datalast_qsctr	Mon Nov 29 13:05:54 2004
+++ 25-akpm/kernel/rcupdate.c	Mon Nov 29 13:05:54 2004
@@ -219,9 +219,9 @@ static void rcu_check_quiescent_state(st
 			struct rcu_state *rsp, struct rcu_data *rdp)
 {
 	if (rdp->quiescbatch != rcp->cur) {
-		/* new grace period: record qsctr value. */
+		/* new grace period: reset qsctr value. */
 		rdp->qs_pending = 1;
-		rdp->last_qsctr = rdp->qsctr;
+		rdp->qsctr = 0;
 		rdp->quiescbatch = rcp->cur;
 		return;
 	}
@@ -233,12 +233,7 @@ static void rcu_check_quiescent_state(st
 	if (!rdp->qs_pending)
 		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.
-	 */
-	if (rdp->qsctr == rdp->last_qsctr)
+	if (rdp->qsctr == 0)
 		return;
 	rdp->qs_pending = 0;
 
_