From 17b3fed12daae4af3b970beac31a182dc6cee044 Mon Sep 17 00:00:00 2001 From: Manfred Spraul Date: Tue, 4 Jan 2005 05:31:02 -0800 Subject: [PATCH] rcu: simplify quiescent state detection Based on an initial patch from Oleg Nesterov 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/rcupdate.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 3f6c5e4cb92c..4d747433916b 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -87,9 +87,7 @@ static inline int rcu_batch_after(long a, long b) 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 passed_quiesc; /* User-mode/idle loop etc. */ int qs_pending; /* core waits for quiesc state */ /* 2) batch handling */ @@ -109,17 +107,20 @@ extern struct rcu_ctrlblk rcu_ctrlblk; extern struct rcu_ctrlblk rcu_bh_ctrlblk; /* - * Increment the quiscent state counter. + * Increment the quiescent state counter. + * The counter is a bit degenerated: We do not need to know + * how many quiescent states passed, just if there was at least + * one since the start of the grace period. Thus just a flag. */ static inline void rcu_qsctr_inc(int cpu) { struct rcu_data *rdp = &per_cpu(rcu_data, cpu); - rdp->qsctr++; + rdp->passed_quiesc = 1; } static inline void rcu_bh_qsctr_inc(int cpu) { struct rcu_data *rdp = &per_cpu(rcu_bh_data, cpu); - rdp->qsctr++; + rdp->passed_quiesc = 1; } static inline int __rcu_pending(struct rcu_ctrlblk *rcp, -- cgit v1.2.3