summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-06-23 18:49:55 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-06-23 18:49:55 -0700
commit72914d307d2ab4630212644a46cf75746d04440d (patch)
tree6ff9700741aba1eb08381bd6437bd82bbed8d60a /include/linux
parent720e8a63908eb18aad1721c1429e89fbf7cf0ca6 (diff)
[PATCH] rcu lock update: Code move & cleanup
From: Manfred Spraul <manfred@colorfullife.com> Step three for reducing cacheline trashing within rcupdate.c: Cleanup and code move from <linux/rcupdate.h> to kernel/rcupdate.c: Remove internal details from the header file. 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/linux')
-rw-r--r--include/linux/rcupdate.h27
1 files changed, 8 insertions, 19 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 883fc03ed4ef..967b2d47014b 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -64,24 +64,13 @@ struct rcu_head {
-/* Control variables for rcupdate callback mechanism. */
+/* Global control variables for rcupdate callback mechanism. */
struct rcu_ctrlblk {
- /* "const" members: only changed when starting/ending a grace period */
- struct {
- long cur; /* Current batch number. */
- long completed; /* Number of the last completed batch */
- int next_pending; /* Is the next batch already waiting? */
- seqcount_t lock; /* for atomically reading cur and */
- /* next_pending. Spinlock not used, */
- /* protected by state.mutex */
- } batch ____cacheline_maxaligned_in_smp;
- /* remaining members: bookkeeping of the progress of the grace period */
- struct {
- spinlock_t mutex; /* Guard this struct */
- cpumask_t rcu_cpu_mask; /* CPUs that need to switch */
- /* in order for current batch to proceed. */
- } state ____cacheline_maxaligned_in_smp;
-};
+ long cur; /* Current batch number. */
+ long completed; /* Number of the last completed batch */
+ int next_pending; /* Is the next batch already waiting? */
+ seqcount_t lock; /* For atomic reads of cur and next_pending. */
+} ____cacheline_maxaligned_in_smp;
/* Is batch a before batch b ? */
static inline int rcu_batch_before(long a, long b)
@@ -131,14 +120,14 @@ static inline int rcu_pending(int cpu)
* for them has completed.
*/
if (!list_empty(&RCU_curlist(cpu)) &&
- !rcu_batch_before(rcu_ctrlblk.batch.completed,RCU_batch(cpu)))
+ !rcu_batch_before(rcu_ctrlblk.completed,RCU_batch(cpu)))
return 1;
/* This cpu has no pending entries, but there are new entries */
if (list_empty(&RCU_curlist(cpu)) &&
!list_empty(&RCU_nxtlist(cpu)))
return 1;
/* The rcu core waits for a quiescent state from the cpu */
- if (RCU_quiescbatch(cpu) != rcu_ctrlblk.batch.cur || RCU_qs_pending(cpu))
+ if (RCU_quiescbatch(cpu) != rcu_ctrlblk.cur || RCU_qs_pending(cpu))
return 1;
/* nothing to do */
return 0;