From patchwork Fri Jun 15 21:06:00 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: 9353 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 970E923E0C for ; Fri, 15 Jun 2012 21:06:41 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 677A0A1821D for ; Fri, 15 Jun 2012 21:06:41 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so3105504yhp.11 for ; Fri, 15 Jun 2012 14:06:41 -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=pF+FofteSCoNPhoY0xr2gkuGAzM+TZ3NveM8tXME/8U=; b=dn49KQ9FI4JI6Ms2c9sFFI327RnSVcwVpK6R7VP0x/RJIoYFutrQ7iZP2pqIwXYL0a 61PTH7fgMc1VyEFMCITjRcM6Jhc7M+oYfWF/BahtxKqibf81D1mUBOogHtm2/JlKvYVB Q1OgZGutzj5gEwyy+X6RPNU+A+L2zKEkvBuo0MK7ueugSlQQnjvPwZ44wtjeMdUbyy3C pmnOKxGHb6dUW0RuW2MfDSKc7bcLryt951lMfoZlez203K5V5BedSn9SajbOv17GTBEi IBI6hFEG4KN3NVmL/CfmmyGS6VAzrHJw5HRwgxqAzqnWAwS5pBhfIboWYb7N72xfw8fE 5S0g== Received: by 10.50.203.39 with SMTP id kn7mr3249425igc.53.1339794401027; Fri, 15 Jun 2012 14:06:41 -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 v20csp169704ibb; Fri, 15 Jun 2012 14:06:40 -0700 (PDT) Received: by 10.68.194.201 with SMTP id hy9mr24177648pbc.69.1339794400167; Fri, 15 Jun 2012 14:06:40 -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 gk9si14969101pbc.38.2012.06.15.14.06.39 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 15 Jun 2012 14:06:40 -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, 15 Jun 2012 15:06:39 -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, 15 Jun 2012 15:06:36 -0600 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id EF7651FF0029; Fri, 15 Jun 2012 21:06:28 +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 q5FL6HZ6144888; Fri, 15 Jun 2012 15:06:19 -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 q5FL6CAZ001983; Fri, 15 Jun 2012 15:06:16 -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 q5FL6CWk001950; Fri, 15 Jun 2012 15:06:12 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 54091E71A0; Fri, 15 Jun 2012 14:06:12 -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 05/15] rcu: Move _rcu_barrier()'s rcu_head structures to rcu_data structures Date: Fri, 15 Jun 2012 14:06:00 -0700 Message-Id: <1339794370-28119-5-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1339794370-28119-1-git-send-email-paulmck@linux.vnet.ibm.com> References: <20120615210550.GA27506@linux.vnet.ibm.com> <1339794370-28119-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12061521-6148-0000-0000-000006BD8721 X-Gm-Message-State: ALoCoQlR72Ze8BxpuEXg9ARgjR3913hOpHcUgfgo38aNztrn5gDfEpiA66I3cyDttFdqOy2SDTIG From: "Paul E. McKenney" In order for multiple flavors of RCU to each concurrently run one rcu_barrier(), each flavor needs its own per-CPU set of rcu_head structures. This commit therefore moves _rcu_barrier()'s set of per-CPU rcu_head structures from per-CPU variables to the existing per-CPU and per-RCU-flavor rcu_data structures. Signed-off-by: Paul E. McKenney Signed-off-by: Paul E. McKenney Reviewed-by: Josh Triplett --- kernel/rcutree.c | 6 ++---- kernel/rcutree.h | 3 +++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/kernel/rcutree.c b/kernel/rcutree.c index 8b3ab4e..2cfbdb8 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c @@ -157,7 +157,6 @@ unsigned long rcutorture_vernum; /* State information for rcu_barrier() and friends. */ -static DEFINE_PER_CPU(struct rcu_head, rcu_barrier_head) = {NULL}; static atomic_t rcu_barrier_cpu_count; static DEFINE_MUTEX(rcu_barrier_mutex); static struct completion rcu_barrier_completion; @@ -2279,12 +2278,11 @@ static void rcu_barrier_callback(struct rcu_head *notused) */ static void rcu_barrier_func(void *type) { - int cpu = smp_processor_id(); - struct rcu_head *head = &per_cpu(rcu_barrier_head, cpu); struct rcu_state *rsp = type; + struct rcu_data *rdp = __this_cpu_ptr(rsp->rda); atomic_inc(&rcu_barrier_cpu_count); - rsp->call(head, rcu_barrier_callback); + rsp->call(&rdp->barrier_head, rcu_barrier_callback); } /* diff --git a/kernel/rcutree.h b/kernel/rcutree.h index 15837d7..1783eae 100644 --- a/kernel/rcutree.h +++ b/kernel/rcutree.h @@ -300,6 +300,9 @@ struct rcu_data { unsigned long n_rp_need_fqs; unsigned long n_rp_need_nothing; + /* 6) _rcu_barrier() callback. */ + struct rcu_head barrier_head; + int cpu; struct rcu_state *rsp; };