From patchwork Fri Jun 22 15:35:07 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: 9571 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 797CD23E55 for ; Fri, 22 Jun 2012 15:36:13 +0000 (UTC) Received: from mail-yw0-f50.google.com (mail-yw0-f50.google.com [209.85.213.50]) by fiordland.canonical.com (Postfix) with ESMTP id 43232A188FD for ; Fri, 22 Jun 2012 15:36:13 +0000 (UTC) Received: by mail-yw0-f50.google.com with SMTP id j63so1929098yhj.37 for ; Fri, 22 Jun 2012 08:36:13 -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=AH/J7rhzJT4uMqV3FRU8gEutgbxTpfk/d/rtvkXs+3I=; b=BWFP2cg0kV46cMp9k3KDlh+RPEiiD0UCR3RgloEuEmcQerrRng0zDdK3cyx4DdqEJF iMJkLcyvpMaiRy4voOQCBzWvFlZFblCWNUY0H/qpAnmZcyXlM9pCO8d5eJkzdE3/Wedy sWo3HfL7CuBqiPDRPDQslMaPtmx87zpWyvi1OMX9CrlqkBIPWEMRarrt0VzEMbbSKa1C JolI30mg+rmmTptxH/Qy37ku2EmnInUlibJB7xgg/xyN0SflQAzXPSAoTCfSca4FThGz 25/BZvmVSHr1U6qze4YBR6oBv/hNeK6Se6ZFo6kvObCiVT6lX2qs+ZOba/jcSrbyfoYO uppA== Received: by 10.50.195.234 with SMTP id ih10mr2112179igc.0.1340379372903; Fri, 22 Jun 2012 08:36:12 -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 v20csp72385ibb; Fri, 22 Jun 2012 08:36:12 -0700 (PDT) Received: by 10.68.224.225 with SMTP id rf1mr11537350pbc.55.1340379371961; Fri, 22 Jun 2012 08:36:11 -0700 (PDT) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com. [32.97.110.153]) by mx.google.com with ESMTPS id qa1si10078009pbb.126.2012.06.22.08.36.11 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jun 2012 08:36:11 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.153 as permitted sender) client-ip=32.97.110.153; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.153 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Jun 2012 09:36:10 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 22 Jun 2012 09:36:08 -0600 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 888BFC40003; Fri, 22 Jun 2012 15:36:05 +0000 (WET) 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 q5MFZRwZ096752; Fri, 22 Jun 2012 09:35:29 -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 q5MFZFND023187; Fri, 22 Jun 2012 09:35:17 -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 q5MFZFDq023081; Fri, 22 Jun 2012 09:35:15 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 6015CE71AE; 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 12/17] rcu: Prevent __call_rcu() from invoking RCU core on offline CPUs Date: Fri, 22 Jun 2012 08:35:07 -0700 Message-Id: <1340379312-6684-12-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-6148-0000-0000-000006F5FA42 X-Gm-Message-State: ALoCoQlKIOvdJrDd+Qf0EVxfNd6OcOamaoRusE76f720BrJSoYcX6ejCFSZf81WdD1BuZHFYPssM From: "Paul E. McKenney" The __call_rcu() function will invoke the RCU core, for example, if it detects that the current CPU has too many callbacks. However, this can happen on an offline CPU that is on its way to the idle loop, in which case it is an error to invoke the RCU core, and the excess callbacks will be adopted in any case. This commit therefore adds checks to __call_rcu() for running on an offline CPU, refraining from invoking the RCU core in this case. Signed-off-by: Paul E. McKenney Signed-off-by: Paul E. McKenney Reviewed-by: Josh Triplett --- kernel/rcutree.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 7720177..9419ebf 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -1901,11 +1901,11 @@ __call_rcu(struct rcu_head *head, void (*func)(struct rcu_head *rcu), * If called from an extended quiescent state, invoke the RCU * core in order to force a re-evaluation of RCU's idleness. */ - if (rcu_is_cpu_idle()) + if (rcu_is_cpu_idle() && cpu_online(smp_processor_id())) invoke_rcu_core(); - /* If interrupts were disabled, don't dive into RCU core. */ - if (irqs_disabled_flags(flags)) { + /* If interrupts were disabled or CPU offline, don't invoke RCU core. */ + if (irqs_disabled_flags(flags) || cpu_is_offline(smp_processor_id())) { local_irq_restore(flags); return; }