]> git.karo-electronics.de Git - karo-tx-linux.git/commit
rcu: Flip ->completed only once per SRCU grace period
authorLai Jiangshan <laijs@cn.fujitsu.com>
Thu, 23 Feb 2012 00:43:55 +0000 (16:43 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 25 Apr 2012 03:55:40 +0000 (20:55 -0700)
commitea04303cc877ee58c7fd4df1946a547db80e5d90
treef07a28086a09eb07e75e81fc238477c38fcea8c3
parent4e972bb75eed349203a1b53b50cbc1ef4e44aeeb
rcu: Flip ->completed only once per SRCU grace period

This is an optimization of the SRCU grace period.  To guard against
preempted readers with old values of the counter, it suffices to scan the
old counters once more, then flip ->completed only one time.  The reason
this works is that the old readers must have incremented the old set of
counters (if they have not yet incremented, then their critical section
starts after this grace period, so they may be safely ignored).

This commit therefore optimizes the second flip out in favor of a simple
rescan.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/srcu.c