]> git.karo-electronics.de Git - karo-tx-linux.git/commit
rcu: Implement a variant of Peter's SRCU algorithm
authorLai Jiangshan <laijs@cn.fujitsu.com>
Mon, 27 Feb 2012 17:29:09 +0000 (09:29 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 25 Apr 2012 03:55:41 +0000 (20:55 -0700)
commit6f347b1d49f91b29c1bf0888416a5bba71a987b1
treecb178106323d6d3ab40571d853d62f34b57e9c79
parent64196cd7550ffc8a8c7e427ca3bce336a5425be8
rcu: Implement a variant of Peter's SRCU algorithm

This commit implements a variant of Peter's algorithm, which may be found
at https://lkml.org/lkml/2012/2/1/119.

o Make the checking lock-free to enable parallel checking.
Parallel checking is required when (1) the original checking
task is preempted for a long time, (2) sychronize_srcu_expedited()
starts during an ongoing SRCU grace period, or (3) we wish to
avoid acquiring a lock.

o Since the checking is lock-free, we avoid a mutex in state machine
for call_srcu().

o Remove the SRCU_REF_MASK and remove the coupling with the flipping.
This might allow us to remove the preempt_disable() in future
versions, though such removal will need great care because it
rescinds the one-old-reader-per-CPU guarantee.

o Remove a smp_mb(), simplify the comments and make the smp_mb() pairs
more intuitive.

Inspired-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
include/linux/srcu.h
kernel/srcu.c