summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/linux/rcupdate.h13
1 files changed, 7 insertions, 6 deletions
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,