From patchwork Thu Sep 20 18:48:14 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: 11608 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 8E1ED23E54 for ; Thu, 20 Sep 2012 18:49:31 +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 10678A183C1 for ; Thu, 20 Sep 2012 18:49:30 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so3420758iej.11 for ; Thu, 20 Sep 2012 11:49:30 -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=m/GseYHBBG6KJn84FtN+qo2ZsmIdlRnQYn6gtkAEtNA=; b=RlRs02YmSeA4jN4wg5xwIOoXOVZ81F+kgxXCpRWC7k603RSlo62cDMrcY9RSkfxEsf wAqNIstgYc+wwy2HUfjzyrgsS26dEndauQ03EiLE2Ffsa4L9r9fDl6f76raZ3gwUfAH4 JMzmjcCrP8vf8K/aeguvLyBcYlFJvSHrj6gfOKRiYxSkLmBfD0J7d8FUhN8cVxyJnqNk Qs8vBqn8jFUaN+Jvxwjy61DUiPdPRpsxWbuqFt5TQ/XcZz+cYheTTNF++q0ZSsBKB7aw jpzJa/TDCbBAjRW/C/AwGLr+BU8fRtzHgVWexLd6jIL7PLfCtbtgJwW/xo8PkXlXmAGO 0QkQ== Received: by 10.50.7.212 with SMTP id l20mr2552462iga.43.1348166970853; Thu, 20 Sep 2012 11:49:30 -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 ex8csp92262igc; Thu, 20 Sep 2012 11:49:30 -0700 (PDT) Received: by 10.50.77.131 with SMTP id s3mr2591552igw.20.1348166970532; Thu, 20 Sep 2012 11:49:30 -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 cw2si9798158icc.16.2012.09.20.11.49.30 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Sep 2012 11:49:30 -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:49:29 -0600 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) 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:49:27 -0600 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 12CB419D803C for ; Thu, 20 Sep 2012 12:49:16 -0600 (MDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q8KImxmg226770 for ; Thu, 20 Sep 2012 12:49:02 -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 q8KImSoT021399 for ; Thu, 20 Sep 2012 12:48:52 -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 q8KImPnf020987; Thu, 20 Sep 2012 12:48:25 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id A4DD5EC534; 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 18/23] rcu: Adjust for unconditional ->completed assignment Date: Thu, 20 Sep 2012 11:48:14 -0700 Message-Id: <1348166900-18716-18-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-000002F74F76 X-Gm-Message-State: ALoCoQlOp6hGFoH16pP1d0TA8UPcX6KKcBey34CN1PXxDiiohp0CYnmXakuqEVf1t6p6eH+dfClY From: "Paul E. McKenney" Now that the rcu_node structures' ->completed fields are unconditionally assigned at grace-period cleanup time, they should already have the correct value for the new grace period at grace-period initialization time. This commit therefore inserts a WARN_ON_ONCE() to verify this invariant. Signed-off-by: Paul E. McKenney Reviewed-by: Josh Triplett --- kernel/rcutree.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 5cb003d..71ae31b 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -1078,6 +1078,7 @@ static int rcu_gp_init(struct rcu_state *rsp) rcu_preempt_check_blocked_tasks(rnp); rnp->qsmask = rnp->qsmaskinit; rnp->gpnum = rsp->gpnum; + WARN_ON_ONCE(rnp->completed != rsp->completed); rnp->completed = rsp->completed; if (rnp == rdp->mynode) rcu_start_gp_per_cpu(rsp, rnp, rdp); @@ -2775,7 +2776,8 @@ static void __init rcu_init_one(struct rcu_state *rsp, raw_spin_lock_init(&rnp->fqslock); lockdep_set_class_and_name(&rnp->fqslock, &rcu_fqs_class[i], fqs[i]); - rnp->gpnum = 0; + rnp->gpnum = rsp->gpnum; + rnp->completed = rsp->completed; rnp->qsmask = 0; rnp->qsmaskinit = 0; rnp->grplo = j * cpustride;