summaryrefslogtreecommitdiff
path: root/include/linux/seg6_iptunnel.h
diff options
context:
space:
mode:
authorLance Roy <ldr709@gmail.com>2017-01-24 00:35:18 +0300
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2017-01-25 23:53:20 +0300
commitf2c4689640e9a34bc45c013032185ed4ce47e7ff (patch)
treeb83abdbccba941253a9296379e00d09ce355ec2d /include/linux/seg6_iptunnel.h
parent52d7e48b86fc108e45a656d8e53e4237993c481d (diff)
downloadlinux-f2c4689640e9a34bc45c013032185ed4ce47e7ff.tar.xz
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>
Diffstat (limited to 'include/linux/seg6_iptunnel.h')
0 files changed, 0 insertions, 0 deletions