rcu.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
	jiangshanlai@gmail.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
	fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org,
	"Paul E . McKenney" <paulmck@linux.ibm.com>
Subject: [PATCH tip/core/rcu 2/8] rcu: Remove redundant debug_locks check in rcu_read_lock_sched_held()
Date: Thu,  1 Aug 2019 15:42:52 -0700	[thread overview]
Message-ID: <20190801224258.16679-2-paulmck@linux.ibm.com> (raw)
In-Reply-To: <20190801224240.GA16092@linux.ibm.com>

From: "Joel Fernandes (Google)" <joel@joelfernandes.org>

The debug_locks flag can never be true at the end of
rcu_read_lock_sched_held() because it is already checked by the earlier
call todebug_lockdep_rcu_enabled().   This commit therefore removes this
redundant check.

Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
---
 kernel/rcu/update.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index 61df2bf08563..9dd5aeef6e70 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -93,17 +93,13 @@ module_param(rcu_normal_after_boot, int, 0);
  */
 int rcu_read_lock_sched_held(void)
 {
-	int lockdep_opinion = 0;
-
 	if (!debug_lockdep_rcu_enabled())
 		return 1;
 	if (!rcu_is_watching())
 		return 0;
 	if (!rcu_lockdep_current_cpu_online())
 		return 0;
-	if (debug_locks)
-		lockdep_opinion = lock_is_held(&rcu_sched_lock_map);
-	return lockdep_opinion || !preemptible();
+	return lock_is_held(&rcu_sched_lock_map) || !preemptible();
 }
 EXPORT_SYMBOL(rcu_read_lock_sched_held);
 #endif
-- 
2.17.1


  parent reply	other threads:[~2019-08-01 22:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01 22:42 [PATCH tip/core/rcu 0/8] RCU list-traversal lockdep updates for v5.4 Paul E. McKenney
2019-08-01 22:42 ` [PATCH tip/core/rcu 1/8] treewide: Rename rcu_dereference_raw_notrace() to _check() Paul E. McKenney
2019-08-01 22:42 ` Paul E. McKenney [this message]
2019-08-01 22:42 ` [PATCH tip/core/rcu 3/8] rcu: Add support for consolidated-RCU reader checking Paul E. McKenney
2019-08-01 22:42 ` [PATCH tip/core/rcu 4/8] rcu/sync: Remove custom check for RCU readers Paul E. McKenney
2019-08-01 22:42 ` [PATCH tip/core/rcu 5/8] ipv4: Add lockdep condition to fix for_each_entry() Paul E. McKenney
2019-08-01 22:42 ` [PATCH tip/core/rcu 6/8] driver/core: Convert to use built-in RCU list checking Paul E. McKenney
2019-08-01 22:42 ` [PATCH tip/core/rcu 7/8] x86/pci: Pass lockdep condition to pcm_mmcfg_list iterator Paul E. McKenney
2019-08-01 22:42 ` [PATCH tip/core/rcu 8/8] acpi: Use built-in RCU list checking for acpi_ioremaps list Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190801224258.16679-2-paulmck@linux.ibm.com \
    --to=paulmck@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).