From patchwork Fri Jun 22 15:35:12 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: 9577 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 865C623E37 for ; Fri, 22 Jun 2012 15:37:51 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 573C4A1830E for ; Fri, 22 Jun 2012 15:37:51 +0000 (UTC) Received: by ggnf1 with SMTP id f1so1758124ggn.11 for ; Fri, 22 Jun 2012 08:37:50 -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=rKdRo6pQ+P2K9isUPuLDxHk6CpZJ3E+RenuS5OLbkZw=; b=l9o+SU5+ayvvQtI5NLApKK/TpN0U0d6Pbi+CFA2JRdQqViCIh1XSZwOxObwSWWe1+Z rAtzd9XuFGNfVNMpB4TeWdQAlaNDlowfwNHIr16qUoh83CSDK6lhRWMrkOCSxFt5RcQ6 K/U63FGUNndSeBQwYyZCINgr2DojJs9Hcx4s9O16QwnTNd43/OJyAfhxwHirUJWkOjqA ljVkKCZ4ilEyT+8DV+ilbeQd6Ot4PyFLgFKh1xSvk1FZxN95XhAfmFeH6vJUZ4JOqSd1 UCHSwjVNgj4zKbhoxxMIOxDJVa4ykALMNsZMlSyvSlydu5gMEJAzYYe7G4yBEt5DDjOw ZLbA== Received: by 10.50.195.234 with SMTP id ih10mr2119704igc.0.1340379470622; Fri, 22 Jun 2012 08:37:50 -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 v20csp72493ibb; Fri, 22 Jun 2012 08:37:50 -0700 (PDT) Received: by 10.50.219.197 with SMTP id pq5mr2048325igc.21.1340379470161; Fri, 22 Jun 2012 08:37:50 -0700 (PDT) Received: from e37.co.us.ibm.com (e37.co.us.ibm.com. [32.97.110.158]) by mx.google.com with ESMTPS id qf1si1613366pbc.55.2012.06.22.08.37.49 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jun 2012 08:37:50 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.158 as permitted sender) client-ip=32.97.110.158; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.158 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Jun 2012 09:37:48 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 22 Jun 2012 09:37:46 -0600 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id D417D3E40090; Fri, 22 Jun 2012 15:36:12 +0000 (WET) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5MFZXWJ073588; Fri, 22 Jun 2012 09:35:49 -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 q5MFZGIx023234; Fri, 22 Jun 2012 09:35:18 -0600 Received: from paulmck-ThinkPad-W500 ([9.47.24.152]) by d03av01.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q5MFZFgW023099; Fri, 22 Jun 2012 09:35:15 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id B8381E71B1; Fri, 22 Jun 2012 08:35:15 -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" , "Paul E. McKenney" Subject: [PATCH tip/core/rcu 17/17] rcu: Add check for CPUs going offline with callbacks queued Date: Fri, 22 Jun 2012 08:35:12 -0700 Message-Id: <1340379312-6684-17-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1340379312-6684-1-git-send-email-paulmck@linux.vnet.ibm.com> References: <20120622153501.GA6626@linux.vnet.ibm.com> <1340379312-6684-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12062215-7408-0000-0000-0000061D6659 X-Gm-Message-State: ALoCoQmQcFBc0You0zgMill3N0b3M2NQ9NWK1CXXYd+n75nTtFsxDvggC9z8OX6kJkO8ljDafcjE From: "Paul E. McKenney" If a CPU goes offline with callbacks queued, those callbacks might be indefinitely postponed, which can result in a system hang. This commit therefore inserts warnings for this condition. Signed-off-by: Paul E. McKenney Signed-off-by: Paul E. McKenney --- kernel/rcutree.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/kernel/rcutree.c b/kernel/rcutree.c index c0cc41f..f849202 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -1506,6 +1506,9 @@ static void rcu_cleanup_dead_cpu(int cpu, struct rcu_state *rsp) raw_spin_unlock_irqrestore(&rnp->lock, flags); if (need_report & RCU_OFL_TASKS_EXP_GP) rcu_report_exp_rnp(rsp, rnp, true); + WARN_ONCE(rdp->qlen != 0 || rdp->nxtlist != NULL, + "rcu_cleanup_dead_cpu: Callbacks on offline CPU %d: qlen=%lu, nxtlist=%p\n", + cpu, rdp->qlen, rdp->nxtlist); } #else /* #ifdef CONFIG_HOTPLUG_CPU */