diff options
| author | Oleg Nesterov <oleg@tv-sign.ru> | 2005-01-04 05:30:36 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-01-04 05:30:36 -0800 |
| commit | a48d69a5c734ceedc04d351f394d428e032ca4b9 (patch) | |
| tree | 3cb7fdcb8ec4c9b299c3c2537f35d03b010c7b70 /include | |
| parent | 38f808dd88a2128483e0308e93cd4d2d2b7b5023 (diff) | |
[PATCH] rcu: eliminate rcu_ctrlblk.lock
rcu_ctrlblk.lock is used to read the ->cur and ->next_pending
atomically in __rcu_process_callbacks(). It can be replaced
by a couple of memory barriers.
rcu_start_batch:
rcp->next_pending = 0;
smp_wmb();
rcp->cur++;
__rcu_process_callbacks:
rdp->batch = rcp->cur + 1;
smp_rmb();
if (!rcp->next_pending)
rcu_start_batch(rcp, rsp, 1);
This way, if __rcu_process_callbacks() sees incremented ->cur value,
it must also see that ->next_pending == 0 (or rcu_start_batch() is
already in progress on another cpu).
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
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.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 91057d6fafd0..3f6c5e4cb92c 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -65,7 +65,6 @@ struct rcu_ctrlblk { 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 ? */ |
