From patchwork Tue Sep 6 18:00:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 3917 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 B687023FC1 for ; Wed, 7 Sep 2011 06:20:53 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 02AA8A1837A for ; Wed, 7 Sep 2011 06:20:52 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id 18so398726fxd.11 for ; Tue, 06 Sep 2011 23:20:52 -0700 (PDT) Received: by 10.223.76.201 with SMTP id d9mr1585098fak.119.1315376452791; Tue, 06 Sep 2011 23:20:52 -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.152.11.8 with SMTP id m8cs127777lab; Tue, 6 Sep 2011 23:20:52 -0700 (PDT) Received: by 10.151.25.20 with SMTP id c20mr4543101ybj.253.1315376451003; Tue, 06 Sep 2011 23:20:51 -0700 (PDT) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.145]) by mx.google.com with ESMTPS id 13si569369ybn.2.2011.09.06.23.20.49 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 06 Sep 2011 23:20:49 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.145 as permitted sender) client-ip=32.97.182.145; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.145 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by e5.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p875oQXD017343 for ; Wed, 7 Sep 2011 01:50:26 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p876KlpF1896638 for ; Wed, 7 Sep 2011 02:20:47 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p876KheY005169 for ; Wed, 7 Sep 2011 02:20:47 -0400 Received: from paulmck-ThinkPad-W500 (dyn9050016039.mts.ibm.com [9.50.16.39] (may be forged)) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p876KWLr004431; Wed, 7 Sep 2011 02:20:41 -0400 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id 7001A13F89C; Tue, 6 Sep 2011 11:00:53 -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, patches@linaro.org, "Paul E. McKenney" Subject: [PATCH tip/core/rcu 52/55] rcu: Remove one layer of abstraction from PROVE_RCU checking Date: Tue, 6 Sep 2011 11:00:46 -0700 Message-Id: <1315332049-2604-52-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <20110906180015.GA2560@linux.vnet.ibm.com> References: <20110906180015.GA2560@linux.vnet.ibm.com> Simplify things a bit by substituting the definitions of the single-line rcu_read_acquire(), rcu_read_release(), rcu_read_acquire_bh(), rcu_read_release_bh(), rcu_read_acquire_sched(), and rcu_read_release_sched() functions at their call points. Signed-off-by: Paul E. McKenney --- include/linux/rcupdate.h | 53 +++++++--------------------------------------- 1 files changed, 8 insertions(+), 45 deletions(-) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index a9bc36d..9d40e42 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -256,41 +256,8 @@ static inline void rcu_lock_release(struct lockdep_map *map) } extern struct lockdep_map rcu_lock_map; - -static inline void rcu_read_acquire(void) -{ - rcu_lock_acquire(&rcu_lock_map); -} - -static inline void rcu_read_release(void) -{ - rcu_lock_release(&rcu_lock_map); -} - extern struct lockdep_map rcu_bh_lock_map; - -static inline void rcu_read_acquire_bh(void) -{ - rcu_lock_acquire(&rcu_bh_lock_map); -} - -static inline void rcu_read_release_bh(void) -{ - rcu_lock_release(&rcu_bh_lock_map); -} - extern struct lockdep_map rcu_sched_lock_map; - -static inline void rcu_read_acquire_sched(void) -{ - rcu_lock_acquire(&rcu_sched_lock_map); -} - -static inline void rcu_read_release_sched(void) -{ - rcu_lock_release(&rcu_sched_lock_map); -} - extern int debug_lockdep_rcu_enabled(void); /** @@ -382,12 +349,8 @@ static inline int rcu_read_lock_sched_held(void) #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ # define PROVE_RCU(a) do { } while (0) -# define rcu_read_acquire() do { } while (0) -# define rcu_read_release() do { } while (0) -# define rcu_read_acquire_bh() do { } while (0) -# define rcu_read_release_bh() do { } while (0) -# define rcu_read_acquire_sched() do { } while (0) -# define rcu_read_release_sched() do { } while (0) +# define rcu_lock_acquire(a) do { } while (0) +# define rcu_lock_release(a) do { } while (0) static inline int rcu_read_lock_held(void) { @@ -708,7 +671,7 @@ static inline void rcu_read_lock(void) { __rcu_read_lock(); __acquire(RCU); - rcu_read_acquire(); + rcu_lock_acquire(&rcu_lock_map); } /* @@ -728,7 +691,7 @@ static inline void rcu_read_lock(void) */ static inline void rcu_read_unlock(void) { - rcu_read_release(); + rcu_lock_release(&rcu_lock_map); __release(RCU); __rcu_read_unlock(); } @@ -749,7 +712,7 @@ static inline void rcu_read_lock_bh(void) { local_bh_disable(); __acquire(RCU_BH); - rcu_read_acquire_bh(); + rcu_lock_acquire(&rcu_bh_lock_map); } /* @@ -759,7 +722,7 @@ static inline void rcu_read_lock_bh(void) */ static inline void rcu_read_unlock_bh(void) { - rcu_read_release_bh(); + rcu_lock_release(&rcu_bh_lock_map); __release(RCU_BH); local_bh_enable(); } @@ -776,7 +739,7 @@ static inline void rcu_read_lock_sched(void) { preempt_disable(); __acquire(RCU_SCHED); - rcu_read_acquire_sched(); + rcu_lock_acquire(&rcu_sched_lock_map); } /* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */ @@ -793,7 +756,7 @@ static inline notrace void rcu_read_lock_sched_notrace(void) */ static inline void rcu_read_unlock_sched(void) { - rcu_read_release_sched(); + rcu_lock_release(&rcu_sched_lock_map); __release(RCU_SCHED); preempt_enable(); }