[PATCH] Fix RCU race in access of nohz_cpu_mask
authorSrivatsa Vaddagiri <vatsa@in.ibm.com>
Mon, 12 Dec 2005 08:37:07 +0000 (00:37 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 12 Dec 2005 16:57:42 +0000 (08:57 -0800)
commitc3f5902325d3053986e7359f706581d8f032e72f
tree1d56b7626b83556982eafad69c597b180c2ef62b
parent89d46b8778f65223f732d82c0166e0abba20fb1e
[PATCH] Fix RCU race in access of nohz_cpu_mask

Accessing nohz_cpu_mask before incrementing rcp->cur is racy.  It can cause
tickless idle CPUs to be included in rsp->cpumask, which will extend
graceperiods unnecessarily.

Fix this race.  It has been tested using extensions to RCU torture module
that forces various CPUs to become idle.

Signed-off-by: Srivatsa Vaddagiri <vatsa@in.ibm.com>
Cc: Dipankar Sarma <dipankar@in.ibm.com>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/rcupdate.c