From patchwork Fri Jun 15 20:13: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: 9341 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 654AE23E5A for ; Fri, 15 Jun 2012 20:13:40 +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 360DFA184D4 for ; Fri, 15 Jun 2012 20:13:40 +0000 (UTC) Received: by mail-gh0-f180.google.com with SMTP id z12so2899342ghb.11 for ; Fri, 15 Jun 2012 13:13:40 -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=G10TfvO0K8BZIJenUs1lgUsv5MLKbMyCJsjRfHVD9cE=; b=Voe6eE29GliMp82dQri83DrJZt1mP45bbNp0gRey6V7s91bCxl89Sd1WK7ajwTJS3i VB+fuDfijshv3v/sFrEKc/A5bpPmmRMsQ59A271U+8O+vo7+an68PKm2Wx+vRHdY58OM pU2lbycQp9vOlSb+wulSL7on+Du5N3/tYPBz1pK8LTm6TVnbpBTuR9awxNhZHMShU0+3 3NF4DcqHkW8+kPDLyL7fF4/wMy1IOMJqJ8meNUVf9faVfFbKmZqs5+3eAgrNCq/EcD8o BE9RRvkhbm9r94lidMVpT16qCDjs7rHxyrDi7iwZrwUznlUs2TTe5bxltx9/RHvmFGK1 6REA== Received: by 10.50.57.167 with SMTP id j7mr3166079igq.53.1339791219887; Fri, 15 Jun 2012 13:13:39 -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 v20csp167544ibb; Fri, 15 Jun 2012 13:13:39 -0700 (PDT) Received: by 10.68.189.65 with SMTP id gg1mr23291030pbc.10.1339791219112; Fri, 15 Jun 2012 13:13:39 -0700 (PDT) Received: from e36.co.us.ibm.com (e36.co.us.ibm.com. [32.97.110.154]) by mx.google.com with ESMTPS id sr7si17772610pbc.36.2012.06.15.13.13.38 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 15 Jun 2012 13:13:39 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.154 as permitted sender) client-ip=32.97.110.154; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.110.154 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 15 Jun 2012 14:13:38 -0600 Received: from d03dlp02.boulder.ibm.com (9.17.202.178) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 15 Jun 2012 14:13:35 -0600 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id BAC343E40049; Fri, 15 Jun 2012 20:13:32 +0000 (WET) 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 q5FKDQ6I164442; Fri, 15 Jun 2012 14:13:28 -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 q5FKDKaW015559; Fri, 15 Jun 2012 14:13:26 -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 q5FKDIJb015524; Fri, 15 Jun 2012 14:13:19 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id A44CEE719E; Fri, 15 Jun 2012 13:13:18 -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, patches@linaro.org, "Paul E. McKenney" , "Paul E. McKenney" Subject: [PATCH tip/core/rcu 12/14] rcu: Prevent __call_rcu() from invoking RCU core on offline CPUs Date: Fri, 15 Jun 2012 13:13:13 -0700 Message-Id: <1339791195-26389-12-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1339791195-26389-1-git-send-email-paulmck@linux.vnet.ibm.com> References: <20120615201256.GA26120@linux.vnet.ibm.com> <1339791195-26389-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12061520-7606-0000-0000-00000129061F X-Gm-Message-State: ALoCoQn5OgkZ6J4QzSXoj8K4JDk1/0ASlGvEbq8nly2tVe3/HMZ1z9Q1CIVtHOX1My/GY3UJe15p 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; }