LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] locking/lockdep: Don't complain about wrong name for no validate class
@ 2019-05-17 21:22 Sebastian Andrzej Siewior
  2019-05-24  6:41 ` Ingo Molnar
  2019-05-24  6:46 ` [tip:locking/core] locking/lockdep: Don't complain about incorrect " tip-bot for Sebastian Andrzej Siewior
  0 siblings, 2 replies; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2019-05-17 21:22 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Zijlstra, Ingo Molnar, Will Deacon, tglx,
	Sebastian Andrzej Siewior

It is possible to ignore the validation for a certain log be using
	lockdep_set_novalidate_class()

on it. Each invocation will assign a new name to the class it created
for created __lockdep_no_validate__. That means that once
lockdep_set_novalidate_class() has been used on two locks then
class->name won't match lock->name for the first lock triggering the
warning.

Ignoring changed non-matching ->name pointer for the
__lockdep_no_validate__ class.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/locking/lockdep.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index d06190fa50822..38be69d344f7f 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -731,7 +731,8 @@ look_up_lock_class(const struct lockdep_map *lock, unsigned int subclass)
 			 * Huh! same key, different name? Did someone trample
 			 * on some memory? We're most confused.
 			 */
-			WARN_ON_ONCE(class->name != lock->name);
+			WARN_ON_ONCE(class->name != lock->name &&
+				     lock->key != &__lockdep_no_validate__);
 			return class;
 		}
 	}
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] locking/lockdep: Don't complain about wrong name for no validate class
  2019-05-17 21:22 [PATCH] locking/lockdep: Don't complain about wrong name for no validate class Sebastian Andrzej Siewior
@ 2019-05-24  6:41 ` Ingo Molnar
  2019-05-24  6:46 ` [tip:locking/core] locking/lockdep: Don't complain about incorrect " tip-bot for Sebastian Andrzej Siewior
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2019-05-24  6:41 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior
  Cc: linux-kernel, Peter Zijlstra, Ingo Molnar, Will Deacon, tglx


* Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:

> It is possible to ignore the validation for a certain log be using
> 	lockdep_set_novalidate_class()

s/log/lock
s/be/by

?

> on it. Each invocation will assign a new name to the class it created
> for created __lockdep_no_validate__. That means that once
> lockdep_set_novalidate_class() has been used on two locks then
> class->name won't match lock->name for the first lock triggering the
> warning.
> 
> Ignoring changed non-matching ->name pointer for the
> __lockdep_no_validate__ class.
> 
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
>  kernel/locking/lockdep.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index d06190fa50822..38be69d344f7f 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -731,7 +731,8 @@ look_up_lock_class(const struct lockdep_map *lock, unsigned int subclass)
>  			 * Huh! same key, different name? Did someone trample
>  			 * on some memory? We're most confused.
>  			 */
> -			WARN_ON_ONCE(class->name != lock->name);
> +			WARN_ON_ONCE(class->name != lock->name &&
> +				     lock->key != &__lockdep_no_validate__);

Looks good otherwise - applied.

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:locking/core] locking/lockdep: Don't complain about incorrect name for no validate class
  2019-05-17 21:22 [PATCH] locking/lockdep: Don't complain about wrong name for no validate class Sebastian Andrzej Siewior
  2019-05-24  6:41 ` Ingo Molnar
@ 2019-05-24  6:46 ` tip-bot for Sebastian Andrzej Siewior
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Sebastian Andrzej Siewior @ 2019-05-24  6:46 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: will.deacon, torvalds, tglx, bigeasy, hpa, mingo, linux-kernel, peterz

Commit-ID:  978315462d3ea3cf6cfacd34c563ec1eb02a3aa5
Gitweb:     https://git.kernel.org/tip/978315462d3ea3cf6cfacd34c563ec1eb02a3aa5
Author:     Sebastian Andrzej Siewior <bigeasy@linutronix.de>
AuthorDate: Fri, 17 May 2019 23:22:34 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 24 May 2019 08:41:59 +0200

locking/lockdep: Don't complain about incorrect name for no validate class

It is possible to ignore the validation for a certain lock by using:

	lockdep_set_novalidate_class()

on it. Each invocation will assign a new name to the class it created
for created __lockdep_no_validate__. That means that once
lockdep_set_novalidate_class() has been used on two locks then
class->name won't match lock->name for the first lock triggering the
warning.

So ignore changed non-matching ->name pointer for the special
__lockdep_no_validate__ class.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Link: http://lkml.kernel.org/r/20190517212234.32611-1-bigeasy@linutronix.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/locking/lockdep.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index c47788fa85f9..6b283b4f87aa 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -732,7 +732,8 @@ look_up_lock_class(const struct lockdep_map *lock, unsigned int subclass)
 			 * Huh! same key, different name? Did someone trample
 			 * on some memory? We're most confused.
 			 */
-			WARN_ON_ONCE(class->name != lock->name);
+			WARN_ON_ONCE(class->name != lock->name &&
+				     lock->key != &__lockdep_no_validate__);
 			return class;
 		}
 	}

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-24  6:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-17 21:22 [PATCH] locking/lockdep: Don't complain about wrong name for no validate class Sebastian Andrzej Siewior
2019-05-24  6:41 ` Ingo Molnar
2019-05-24  6:46 ` [tip:locking/core] locking/lockdep: Don't complain about incorrect " tip-bot for Sebastian Andrzej Siewior

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).