From patchwork Fri Jul 8 15:43:53 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: 2606 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 4E89F23F41 for ; Fri, 8 Jul 2011 15:44:18 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id 1EB2DA187A6 for ; Fri, 8 Jul 2011 15:44:18 +0000 (UTC) Received: by qyk30 with SMTP id 30so1429839qyk.11 for ; Fri, 08 Jul 2011 08:44:17 -0700 (PDT) Received: by 10.229.1.140 with SMTP id 12mr1695126qcf.118.1310139857556; Fri, 08 Jul 2011 08:44:17 -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.229.48.135 with SMTP id r7cs139265qcf; Fri, 8 Jul 2011 08:44:17 -0700 (PDT) Received: by 10.52.27.103 with SMTP id s7mr2917549vdg.96.1310139857167; Fri, 08 Jul 2011 08:44:17 -0700 (PDT) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.141]) by mx.google.com with ESMTPS id fx9si9849599vdc.136.2011.07.08.08.44.17 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Jul 2011 08:44:17 -0700 (PDT) Received-SPF: pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.141 as permitted sender) client-ip=32.97.182.141; Authentication-Results: mx.google.com; spf=pass (google.com: domain of paulmck@linux.vnet.ibm.com designates 32.97.182.141 as permitted sender) smtp.mail=paulmck@linux.vnet.ibm.com Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by e1.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p68FW4pW024861 for ; Fri, 8 Jul 2011 11:32:04 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p68FiGVQ118088 for ; Fri, 8 Jul 2011 11:44:16 -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 p68Fi8KP028677 for ; Fri, 8 Jul 2011 11:44:15 -0400 Received: from paulmck-ThinkPad-W500 (sig-9-65-152-173.mts.ibm.com [9.65.152.173]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p68Fi31J028096; Fri, 8 Jul 2011 11:44:04 -0400 Received: by paulmck-ThinkPad-W500 (Postfix, from userid 1000) id C8D1A13F807; Fri, 8 Jul 2011 08:43:54 -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 6/6] rcu: Make srcu_read_lock_held() call common lockdep-enabled function Date: Fri, 8 Jul 2011 08:43:53 -0700 Message-Id: <1310139833-20804-6-git-send-email-paulmck@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.3.2 In-Reply-To: <20110708154331.GA20161@linux.vnet.ibm.com> References: <20110708154331.GA20161@linux.vnet.ibm.com> A common debug_lockdep_rcu_enabled() function is used to check whether RCU lockdep splats should be reported, but srcu_read_lock() does not use it. This commit therefore brings srcu_read_lock_held() up to date. Signed-off-by: Paul E. McKenney --- include/linux/srcu.h | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/include/linux/srcu.h b/include/linux/srcu.h index fcbaee7..54a70b7 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h @@ -84,6 +84,9 @@ long srcu_batches_completed(struct srcu_struct *sp); * this assumes we are in an SRCU read-side critical section unless it can * prove otherwise. * + * Checks debug_lockdep_rcu_enabled() to prevent false positives during boot + * and while lockdep is disabled. + * * Note that if the CPU is in an extended quiescent state, for example, * if the CPU is in dyntick-idle mode, then rcu_read_lock_held() returns * false even if the CPU did an rcu_read_lock(). The reason for this is @@ -96,7 +99,7 @@ long srcu_batches_completed(struct srcu_struct *sp); */ static inline int srcu_read_lock_held(struct srcu_struct *sp) { - if (debug_locks) + if (!debug_lockdep_rcu_enabled()) return lock_is_held(&sp->dep_map); if (rcu_check_extended_qs()) return 0;