aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcutree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-07-07 08:57:03 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2012-09-23 10:41:55 -0400
commit661a85dc0d2ec0404e3b80909e413a9d5e42a239 (patch)
tree8ea9545a62835d8cd47978fd31ede669f988b43a /kernel/rcutree.c
parent5d4b86594984d8746b01487c768d8548463c173f (diff)
rcu: Add random PROVE_RCU_DELAY to grace-period initialization
Preemption greatly raised the probability of certain types of race conditions, so this commit adds an anti-heisenbug to greatly increase the collision cross section, also known as the probability of occurrence. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/rcutree.c')
-rw-r--r--kernel/rcutree.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/rcutree.c b/kernel/rcutree.c
index 145f27fe3a1f..f0f3a18c0a20 100644
--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -52,6 +52,7 @@
52#include <linux/prefetch.h> 52#include <linux/prefetch.h>
53#include <linux/delay.h> 53#include <linux/delay.h>
54#include <linux/stop_machine.h> 54#include <linux/stop_machine.h>
55#include <linux/random.h>
55 56
56#include "rcutree.h" 57#include "rcutree.h"
57#include <trace/events/rcu.h> 58#include <trace/events/rcu.h>
@@ -1087,6 +1088,10 @@ static int rcu_gp_init(struct rcu_state *rsp)
1087 rnp->level, rnp->grplo, 1088 rnp->level, rnp->grplo,
1088 rnp->grphi, rnp->qsmask); 1089 rnp->grphi, rnp->qsmask);
1089 raw_spin_unlock_irq(&rnp->lock); 1090 raw_spin_unlock_irq(&rnp->lock);
1091#ifdef CONFIG_PROVE_RCU_DELAY
1092 if ((random32() % (rcu_num_nodes * 8)) == 0)
1093 schedule_timeout_uninterruptible(2);
1094#endif /* #ifdef CONFIG_PROVE_RCU_DELAY */
1090 cond_resched(); 1095 cond_resched();
1091 } 1096 }
1092 1097