linux/kernel/rcu
Lance Roy f2c4689640 srcu: Implement more-efficient reader counts
SRCU uses two per-cpu counters: a nesting counter to count the number of
active critical sections, and a sequence counter to ensure that the nesting
counters don't change while they are being added together in
srcu_readers_active_idx_check().

This patch instead uses per-cpu lock and unlock counters. Because both
counters only increase and srcu_readers_active_idx_check() reads the unlock
counter before the lock counter, this achieves the same end without having
to increment two different counters in srcu_read_lock(). This also saves a
smp_mb() in srcu_readers_active_idx_check().

Possible bug: There is no guarantee that the lock counter won't overflow
during srcu_readers_active_idx_check(), as there are no memory barriers
around srcu_flip() (see comment in srcu_readers_active_idx_check() for
details). However, this problem was already present before this patch.

Suggested-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
2017-01-25 12:53:20 -08:00
..
Makefile rcutorture: Add RCU grace-period performance tests 2016-03-31 13:37:38 -07:00
rcu.h rcu: Narrow early boot window of illegal synchronous grace periods 2017-01-14 21:23:48 -08:00
rcuperf.c rcuperf: Consistently insert space between flag and message 2016-08-22 10:06:16 -07:00
rcutorture.c srcu: Implement more-efficient reader counts 2017-01-25 12:53:20 -08:00
srcu.c srcu: Implement more-efficient reader counts 2017-01-25 12:53:20 -08:00
sync.c locking, rcu, cgroup: Avoid synchronize_sched() in __cgroup_procs_write() 2016-08-18 15:36:59 +02:00
tiny_plugin.h rcu: Narrow early boot window of illegal synchronous grace periods 2017-01-14 21:23:48 -08:00
tiny.c rcu: Remove cond_resched() from Tiny synchronize_sched() 2017-01-14 21:22:20 -08:00
tree_exp.h rcu: Narrow early boot window of illegal synchronous grace periods 2017-01-14 21:23:48 -08:00
tree_plugin.h rcu: Narrow early boot window of illegal synchronous grace periods 2017-01-14 21:23:48 -08:00
tree_trace.c rcu: Drive expedited grace periods from workqueue 2016-08-22 09:30:25 -07:00
tree.c rcu: Narrow early boot window of illegal synchronous grace periods 2017-01-14 21:23:48 -08:00
tree.h rcu: Make expedited grace periods recheck dyntick idle state 2016-11-14 10:46:31 -08:00
update.c rcu: Narrow early boot window of illegal synchronous grace periods 2017-01-14 21:23:48 -08:00