Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1670757 > unrolled thread

[tip:locking/core] locking/rtmutex: Don't initialize lockdep when not required

Started by"tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com>
First post2017-06-20 15:30 +0200
Last post2017-06-20 15:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [tip:locking/core] locking/rtmutex: Don't initialize lockdep when  not required "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-20 15:30 +0200

#1670757 — [tip:locking/core] locking/rtmutex: Don't initialize lockdep when not required

From"tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com>
Date2017-06-20 15:30 +0200
Subject[tip:locking/core] locking/rtmutex: Don't initialize lockdep when not required
Message-ID<tUroe-Jj-21@gated-at.bofh.it>
Commit-ID:  cde50a67397c0da7d11795d4b4418384022ab8e6
Gitweb:     http://git.kernel.org/tip/cde50a67397c0da7d11795d4b4418384022ab8e6
Author:     Levin, Alexander (Sasha Levin) <alexander.levin@verizon.com>
AuthorDate: Sun, 18 Jun 2017 14:06:01 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Tue, 20 Jun 2017 11:53:09 +0200

locking/rtmutex: Don't initialize lockdep when not required

pi_mutex isn't supposed to be tracked by lockdep, but just
passing NULLs for name and key will cause lockdep to spew a
warning and die, which is not what we want it to do.

Skip lockdep initialization if the caller passed NULLs for
name and key, suggesting such initialization isn't desired.

Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: f5694788ad8d ("rt_mutex: Add lockdep annotations")
Link: http://lkml.kernel.org/r/20170618140548.4763-1-alexander.levin@verizon.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/locking/rtmutex.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
index 4312353..7806989 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1661,7 +1661,8 @@ void __rt_mutex_init(struct rt_mutex *lock, const char *name,
 	lock->waiters = RB_ROOT;
 	lock->waiters_leftmost = NULL;
 
-	debug_rt_mutex_init(lock, name, key);
+	if (name && key)
+		debug_rt_mutex_init(lock, name, key);
 }
 EXPORT_SYMBOL_GPL(__rt_mutex_init);
 

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web