From patchwork Thu Jul 5 22:33:19 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: 9870 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 E5AC523E23 for ; Thu, 5 Jul 2012 22:36:32 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id ACDA3A18491 for ; Thu, 5 Jul 2012 22:36:32 +0000 (UTC) Received: by ghbz12 with SMTP id z12so8644461ghb.11 for ; Thu, 05 Jul 2012 15:36:32 -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:date:from :to:cc:subject:message-id:reply-to:mime-version:content-type :content-disposition:user-agent:x-content-scanned:x-cbid :x-gm-message-state; bh=FgLa8T026DLtZh0xeo/KDq4VL5kjjQLmFJBh3J420+o=; b=M54ma7tNEaK5v8Z23bjy+mqSbF9ocO9PYitva9ClD7I1CedSnr56JJN249PAZQaNye vsxwcbFggzeLo7Nu88x8nv0XvZhJ2kJ+P4qCK/YNv4cTI7D8KNsNTNh/xo5tgdGTxz9l PwKlh4KJy5q30LkwhI3fwEv0qPYBX25JJC+fNrYA9RJP4+f/ZxV5GHeE2I3Ae3OQ2gIh iRzrgUXeRSo6QlDtL23nDZS38nnTftXYqx4V/qe4Fdyk2kI3apBkwcwnO4DGWPHHE2yB 5cOg606kAmBTq7xpBnOoGB5N9ykYq1mNMBg+EiXottSI6t/t28GiivKEqa4wPNKoXuYu 8nxg== Received: by 10.50.195.234 with SMTP id ih10mr1127875igc.0.1341527792135; Thu, 05 Jul 2012 15:36:32 -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.231.24.148 with SMTP id v20csp1565ibb; Thu, 5 Jul 2012 15:36:31 -0700 (PDT) Received: by 10.68.239.164 with SMTP id vt4mr30257341pbc.166.1341527791296; Thu, 05 Jul 2012 15:36:31 -0700 (PDT) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com. [32.97.110.149]) by mx.google.com with ESMTPS id pu9si24034043pbc.58.2012.07.05.15.36.30 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 Jul 2012 15:36:31 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.149 as permitted sender) client-ip=32.97.110.149; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.149 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 5 Jul 2012 16:36:28 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 5 Jul 2012 16:35:46 -0600 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 6666B3E4004F for ; Thu, 5 Jul 2012 22:34:14 +0000 (WET) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q65MXhX0284830 for ; Thu, 5 Jul 2012 16:33:58 -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 q65MXMqT011628 for ; Thu, 5 Jul 2012 16:33:27 -0600 Received: from paulmck-ThinkPad-W500 ([9.80.25.209]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q65MXL6u011533; Thu, 5 Jul 2012 16:33:22 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 8DF89E4D55; Thu, 5 Jul 2012 15:33:19 -0700 (PDT) Date: Thu, 5 Jul 2012 15:33:19 -0700 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@efficios.com, 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 Subject: [PATCH tip/core/rcu] Introduce check for callback list/count mismatch Message-ID: <20120705223319.GA27331@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12070522-7282-0000-0000-00000AA063F5 X-Gm-Message-State: ALoCoQlraRoMD6G32F7M74hyiFXOherPYG1Lh1iYaoxYVWRxNNxlWfATFeyDY6JOjAGVm+7AVypt The recent bug that introduced the RCU callback list/count mismatch showed the need for a diagnostic to check for this, which this patch adds. Signed-off-by: Paul E. McKenney Signed-off-by: Paul E. McKenney Reviewed-by: Josh Triplett diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 95c7b61..4154c95 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -1612,6 +1612,7 @@ static void rcu_do_batch(struct rcu_state *rsp, struct rcu_data *rdp) rdp->n_force_qs_snap = rsp->n_force_qs; } else if (rdp->qlen < rdp->qlen_last_fqs_check - qhimark) rdp->qlen_last_fqs_check = rdp->qlen; + WARN_ON_ONCE((rdp->nxtlist == NULL) != (rdp->qlen == 0)); local_irq_restore(flags);