From patchwork Wed Nov 2 20:30:36 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: 4919 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 E4C8923DC3 for ; Wed, 2 Nov 2011 20:32:36 +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 D9774A1868D for ; Wed, 2 Nov 2011 20:32:36 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id n26so1195523faa.11 for ; Wed, 02 Nov 2011 13:32:36 -0700 (PDT) Received: by 10.223.91.73 with SMTP id l9mr10782234fam.22.1320265956780; Wed, 02 Nov 2011 13:32:36 -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.14.103 with SMTP id o7cs64086lac; Wed, 2 Nov 2011 13:32:36 -0700 (PDT) Received: by 10.52.76.199 with SMTP id m7mr6300672vdw.63.1320265954566; Wed, 02 Nov 2011 13:32:34 -0700 (PDT) Received: from e8.ny.us.ibm.com (e8.ny.us.ibm.com. [32.97.182.138]) by mx.google.com with ESMTPS id s10si856540vcq.34.2011.11.02.13.32.34 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 02 Nov 2011 13:32:34 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.138 as permitted sender) client-ip=32.97.182.138; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.138 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 2 Nov 2011 16:32:04 -0400 Received: from d01relay02.pok.ibm.com ([9.56.227.234]) by e8.ny.us.ibm.com ([192.168.1.108]) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 2 Nov 2011 16:32:02 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pA2KV27l263518 for ; Wed, 2 Nov 2011 16:31:21 -0400 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pA2KUssB030027 for ; Wed, 2 Nov 2011 16:31:01 -0400 Received: from paulmck-ThinkPad-W500 (sig-9-49-130-61.mts.ibm.com [9.49.130.61]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id pA2KUrvu029895; Wed, 2 Nov 2011 16:30:53 -0400 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id EA523EAA09; Wed, 2 Nov 2011 13:30:51 -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 RFC tip/core/rcu 15/28] rcu: Remove one layer of abstraction from PROVE_RCU checking Date: Wed, 2 Nov 2011 13:30:36 -0700 Message-Id: <1320265849-5744-15-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <20111102203017.GA3830@linux.vnet.ibm.com> References: <20111102203017.GA3830@linux.vnet.ibm.com> x-cbid: 11110220-9360-0000-0000-00000045A627 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 d201c15..5dd6fd8 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h @@ -250,41 +250,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); /** @@ -364,12 +331,8 @@ static inline int rcu_read_lock_sched_held(void) #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ -# 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) { @@ -690,7 +653,7 @@ static inline void rcu_read_lock(void) { __rcu_read_lock(); __acquire(RCU); - rcu_read_acquire(); + rcu_lock_acquire(&rcu_lock_map); } /* @@ -710,7 +673,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(); } @@ -731,7 +694,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); } /* @@ -741,7 +704,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(); } @@ -758,7 +721,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. */ @@ -775,7 +738,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(); }