From patchwork Thu Sep 20 18:48:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 11600 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 9974F24110 for ; Thu, 20 Sep 2012 18:49:00 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3E7B6A18604 for ; Thu, 20 Sep 2012 18:49:00 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so3419662iej.11 for ; Thu, 20 Sep 2012 11:49:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-content-scanned:x-cbid:x-gm-message-state; bh=ygpUQam1SWWThfR+I3Fb949TQQ1EL6sdoiWcK5V29Os=; b=PREpY7om9K+3OaP6r/YbbvEcgnY3tWTS42xrEpGXfgnBOaczz87u/UbC/EXHIBEVx9 IItvPIe3Jj2C7dqeEwJ3w1hVEtZdeOTEERkn0PgWjuBz9bTXUUqx7Tnk+NbSKjsH1pjo aSlgfux0pvz8aUh7QqBQ0blexEPQsbFp6nvQBINYtiHtH2SwuCyrJpO1ANuOV35GOTVv yI/qmRZ2N+MeY95ww+3ka6ccjNAHfZmL8VoPzStt1clGL/E4UxjVe/HvBtam5AUgEAy2 JjrjYsbR07h/0K93bNdgzwqaOqSleZ/MgI1O1QXuTeJrCisKWS+B0orhtooSwkAzsN5t 6CDg== Received: by 10.50.217.229 with SMTP id pb5mr2583986igc.28.1348166940016; Thu, 20 Sep 2012 11:49:00 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp92230igc; Thu, 20 Sep 2012 11:48:59 -0700 (PDT) Received: by 10.50.5.180 with SMTP id t20mr2616943igt.31.1348166939560; Thu, 20 Sep 2012 11:48:59 -0700 (PDT) Received: from e39.co.us.ibm.com (e39.co.us.ibm.com. [32.97.110.160]) by mx.google.com with ESMTPS id k3si9789524igq.60.2012.09.20.11.48.59 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Sep 2012 11:48:59 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.160 as permitted sender) client-ip=32.97.110.160; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.160 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 20 Sep 2012 12:48:58 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e39.co.us.ibm.com (192.168.1.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 20 Sep 2012 12:48:56 -0600 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id E40AF3E40055 for ; Thu, 20 Sep 2012 12:48:52 -0600 (MDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q8KImmTw217374 for ; Thu, 20 Sep 2012 12:48:50 -0600 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q8KImSEf021392 for ; Thu, 20 Sep 2012 12:48:44 -0600 Received: from paulmck-ThinkPad-W500 ([9.47.24.72]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q8KImNlD020802; Thu, 20 Sep 2012 12:48:25 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 935C4EC533; Thu, 20 Sep 2012 11:48:22 -0700 (PDT) From: "Paul E. McKenney" To: linux-kernel@vger.kernel.org Cc: mingo@elte.hu, laijs@cn.fujitsu.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca, josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, Valdis.Kletnieks@vt.edu, dhowells@redhat.com, eric.dumazet@gmail.com, darren@dvhart.com, fweisbec@gmail.com, sbw@mit.edu, patches@linaro.org, "Paul E. McKenney" Subject: [PATCH tip/core/rcu 17/23] rcu: Add random PROVE_RCU_DELAY to grace-period initialization Date: Thu, 20 Sep 2012 11:48:13 -0700 Message-Id: <1348166900-18716-17-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1348166900-18716-1-git-send-email-paulmck@linux.vnet.ibm.com> References: <20120920184751.GA18657@linux.vnet.ibm.com> <1348166900-18716-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12092018-4242-0000-0000-000002F74F0E X-Gm-Message-State: ALoCoQnCYxjC4uskLhYYNFZYzdR2O3CYp4e6X0avjxupHAlcbZ/Acv3eVv90/rubsvx359esl9gM From: "Paul E. McKenney" 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 --- kernel/rcutree.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 25a671c..5cb003d 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -52,6 +52,7 @@ #include #include #include +#include #include "rcutree.h" #include @@ -1085,6 +1086,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(); }