From patchwork Fri Jun 22 15:17:05 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: 9560 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 E051E23E55 for ; Fri, 22 Jun 2012 15:26:32 +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 B0E1CA180D0 for ; Fri, 22 Jun 2012 15:26:32 +0000 (UTC) Received: by mail-yw0-f50.google.com with SMTP id j63so1914109yhj.37 for ; Fri, 22 Jun 2012 08:26: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:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-content-scanned:x-cbid:x-gm-message-state; bh=dqvuwwc1H3WN2vXIZ1SccOogZXkrP4T7UTGqS/K851g=; b=IVL578vzLBTlm8pv36ncG84llXTzoArNdyVIBUdM/wXmn4+wQSxL+rvO4Ca+StC6EQ fvR1MH2CCJKuR9pr+VDzyY3mncH0xBXfu9p57LG4MVlEMbW8yHN4lKfhEBx+7CnOTzZC +bo/dbNXOR+M+cI5XuqIH76nNYpbuwqF3cqbwb37E/wXWMDiHwc9B0ni5S5akEqtuKKK vAejo0z2jgJ06vj42WaB9Q8cHREOQTAYo1+JSGx/21oOLzqcD6/eSKn8FO0rB75IbDCZ H3VFhGrcoj8SBMVZyvy8E3CmzS5DWkHrn86wVDqnV8Dgegvc77R+18IsRgSoXg1BJDO1 TcvA== Received: by 10.50.57.167 with SMTP id j7mr2095702igq.53.1340378792407; Fri, 22 Jun 2012 08:26: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 v20csp71889ibb; Fri, 22 Jun 2012 08:26:31 -0700 (PDT) Received: by 10.68.219.226 with SMTP id pr2mr11319161pbc.1.1340378791249; Fri, 22 Jun 2012 08:26:31 -0700 (PDT) Received: from e2.ny.us.ibm.com (e2.ny.us.ibm.com. [32.97.182.142]) by mx.google.com with ESMTPS id ss6si9978530pbc.333.2012.06.22.08.26.30 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Jun 2012 08:26:31 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.142 as permitted sender) client-ip=32.97.182.142; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.142 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e2.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 22 Jun 2012 11:26:22 -0400 Received: from d01dlp02.pok.ibm.com (9.56.224.85) by e2.ny.us.ibm.com (192.168.1.102) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 22 Jun 2012 11:24:56 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id A3B646E8077; Fri, 22 Jun 2012 11:24:48 -0400 (EDT) Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q5MFOmhY162056; Fri, 22 Jun 2012 11:24:48 -0400 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 q5MFOZkP019583; Fri, 22 Jun 2012 09:24:43 -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 q5MFOZtO019511; Fri, 22 Jun 2012 09:24:35 -0600 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id CBB7FE71AD; Fri, 22 Jun 2012 08:17:22 -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 06/22] rcu: Move _rcu_barrier()'s rcu_head structures to rcu_data structures Date: Fri, 22 Jun 2012 08:17:05 -0700 Message-Id: <1340378241-6458-6-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1340378241-6458-1-git-send-email-paulmck@linux.vnet.ibm.com> References: <20120622151655.GA6249@linux.vnet.ibm.com> <1340378241-6458-1-git-send-email-paulmck@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12062215-5112-0000-0000-0000095476E0 X-Gm-Message-State: ALoCoQkyHKLJQZGTjmI3PbePdAMOxV3T+5Q76u3It3//wNFMDSFTYSFjsbD4PlqUEkkrpr2MF3NM 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 24cd2f0..cb2d35d 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; };