From: Paul E. McKenney Date: Sat, 7 Jul 2012 12:57:03 +0000 (-0700) Subject: rcu: Add random PROVE_RCU_DELAY to grace-period initialization X-Git-Tag: v3.7-rc1~37^2~2^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=661a85dc0d2ec0404e3b80909e413a9d5e42a239;p=platform%2Fkernel%2Flinux-3.10.git 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 Reviewed-by: Josh Triplett --- diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 145f27f..f0f3a18 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -52,6 +52,7 @@ #include #include #include +#include #include "rcutree.h" #include @@ -1087,6 +1088,10 @@ static int rcu_gp_init(struct rcu_state *rsp) rnp->level, rnp->grplo, rnp->grphi, rnp->qsmask); raw_spin_unlock_irq(&rnp->lock); +#ifdef CONFIG_PROVE_RCU_DELAY + if ((random32() % (rcu_num_nodes * 8)) == 0) + schedule_timeout_uninterruptible(2); +#endif /* #ifdef CONFIG_PROVE_RCU_DELAY */ cond_resched(); }