aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree.h
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2009-11-02 13:52:29 -0800
committerIngo Molnar <mingo@elte.hu>2009-11-10 04:12:11 +0100
commit9160306e6f5b68bb64630c9031c517ca1cf463db (patch)
treed8f78f99d417f34121c21e45a4675b2b1d5c2674 /kernel/rcutree.h
parentd09b62dfa336447c52a5ec9bb88adbc479b0f3b8 (diff)
downloadkernel_samsung_smdk4412-9160306e6f5b68bb64630c9031c517ca1cf463db.zip
kernel_samsung_smdk4412-9160306e6f5b68bb64630c9031c517ca1cf463db.tar.gz
kernel_samsung_smdk4412-9160306e6f5b68bb64630c9031c517ca1cf463db.tar.bz2
rcu: Fix note_new_gpnum() uses of ->gpnum
Impose a clear locking design on the note_new_gpnum() function's use of the ->gpnum counter. This is done by updating rdp->gpnum only from the corresponding leaf rcu_node structure's rnp->gpnum field, and even then only under the protection of that same rcu_node structure's ->lock field. Performance and scalability are maintained using a form of double-checked locking, and excessive spinning is avoided by use of the spin_trylock() function. The use of spin_trylock() is safe due to the fact that CPUs who fail to acquire this lock will try again later. The hierarchical nature of the rcu_node data structure limits contention (which could be limited further if need be using the RCU_FANOUT kernel parameter). Without this patch, obscure but quite possible races could result in a quiescent state that occurred during one grace period to be accounted to the following grace period, causing this following grace period to end prematurely. Not good! Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: laijs@cn.fujitsu.com Cc: dipankar@in.ibm.com Cc: mathieu.desnoyers@polymtl.ca Cc: josh@joshtriplett.org Cc: dvhltc@us.ibm.com Cc: niv@us.ibm.com Cc: peterz@infradead.org Cc: rostedt@goodmis.org Cc: Valdis.Kletnieks@vt.edu Cc: dhowells@redhat.com Cc: <stable@kernel.org> # .32.x LKML-Reference: <12571987492350-git-send-email-> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/rcutree.h')
0 files changed, 0 insertions, 0 deletions