linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] locking/lockdep: Remove unnecessary DEBUG_LOCKS_WARN_ON()
@ 2019-05-30 11:59 Kobe Wu
       [not found] ` <1559217575-30298-1-git-send-email-kobe-cp.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
  2019-06-17 14:18 ` [tip:locking/core] " tip-bot for Kobe Wu
  0 siblings, 2 replies; 4+ messages in thread
From: Kobe Wu @ 2019-05-30 11:59 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Will Deacon
  Cc: Eason Lin, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	wsd_upstream-NuS5LvNUpcJWk0Htik3J/w, Kobe Wu

DEBUG_LOCKS_WARN_ON() will turn off debug_locks and 
makes print_unlock_imbalance_bug() return directly.

Remove a redundant whitespace.

Signed-off-by: Kobe Wu <kobe-cp.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
---
 kernel/locking/lockdep.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index d06190f..37c0a5e 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -4049,8 +4049,8 @@ static int __lock_downgrade(struct lockdep_map *lock, unsigned long ip)
 	 * So we're all set to release this lock.. wait what lock? We don't
 	 * own any locks, you've been drinking again?
 	 */
-	if (DEBUG_LOCKS_WARN_ON(depth <= 0))
-		 return print_unlock_imbalance_bug(curr, lock, ip);
+	if (depth <= 0)
+		return print_unlock_imbalance_bug(curr, lock, ip);
 
 	/*
 	 * Check whether the lock exists in the current stack
-- 
1.7.9.5

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

* Re: [PATCH] locking/lockdep: Remove unnecessary DEBUG_LOCKS_WARN_ON()
       [not found] ` <1559217575-30298-1-git-send-email-kobe-cp.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
@ 2019-06-05 12:46   ` Will Deacon
       [not found]     ` <20190605124633.GM15030-UDVVEH7NWB15pKCnmE3YQBJ8xKzm50AiAL8bYrjMMd8@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Will Deacon @ 2019-06-05 12:46 UTC (permalink / raw)
  To: Kobe Wu
  Cc: Peter Zijlstra, Eason Lin, Ingo Molnar,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	wsd_upstream-NuS5LvNUpcJWk0Htik3J/w

On Thu, May 30, 2019 at 07:59:35PM +0800, Kobe Wu wrote:
> DEBUG_LOCKS_WARN_ON() will turn off debug_locks and 
> makes print_unlock_imbalance_bug() return directly.
> 
> Remove a redundant whitespace.
> 
> Signed-off-by: Kobe Wu <kobe-cp.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> ---
>  kernel/locking/lockdep.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index d06190f..37c0a5e 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -4049,8 +4049,8 @@ static int __lock_downgrade(struct lockdep_map *lock, unsigned long ip)
>  	 * So we're all set to release this lock.. wait what lock? We don't
>  	 * own any locks, you've been drinking again?
>  	 */
> -	if (DEBUG_LOCKS_WARN_ON(depth <= 0))
> -		 return print_unlock_imbalance_bug(curr, lock, ip);
> +	if (depth <= 0)
> +		return print_unlock_imbalance_bug(curr, lock, ip);

Hmm, feels more like we should keep the DEBUG_LOCKS_WARN_ON but just
return 0 when it fires.

Peter?

Will

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

* Re: [PATCH] locking/lockdep: Remove unnecessary DEBUG_LOCKS_WARN_ON()
       [not found]     ` <20190605124633.GM15030-UDVVEH7NWB15pKCnmE3YQBJ8xKzm50AiAL8bYrjMMd8@public.gmane.org>
@ 2019-06-05 13:35       ` Peter Zijlstra
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Zijlstra @ 2019-06-05 13:35 UTC (permalink / raw)
  To: Will Deacon
  Cc: Eason Lin, Ingo Molnar,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	wsd_upstream-NuS5LvNUpcJWk0Htik3J/w, Kobe Wu

On Wed, Jun 05, 2019 at 01:46:33PM +0100, Will Deacon wrote:
> On Thu, May 30, 2019 at 07:59:35PM +0800, Kobe Wu wrote:
> > DEBUG_LOCKS_WARN_ON() will turn off debug_locks and 
> > makes print_unlock_imbalance_bug() return directly.
> > 
> > Remove a redundant whitespace.
> > 
> > Signed-off-by: Kobe Wu <kobe-cp.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
> > ---
> >  kernel/locking/lockdep.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> > index d06190f..37c0a5e 100644
> > --- a/kernel/locking/lockdep.c
> > +++ b/kernel/locking/lockdep.c
> > @@ -4049,8 +4049,8 @@ static int __lock_downgrade(struct lockdep_map *lock, unsigned long ip)
> >  	 * So we're all set to release this lock.. wait what lock? We don't
> >  	 * own any locks, you've been drinking again?
> >  	 */
> > -	if (DEBUG_LOCKS_WARN_ON(depth <= 0))
> > -		 return print_unlock_imbalance_bug(curr, lock, ip);
> > +	if (depth <= 0)
> > +		return print_unlock_imbalance_bug(curr, lock, ip);
> 
> Hmm, feels more like we should keep the DEBUG_LOCKS_WARN_ON but just
> return 0 when it fires.
> 
> Peter?

Nah, we should definitely print something when we try and release a lock
while not holding any. I think I'll take this one as is.

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

* [tip:locking/core] locking/lockdep: Remove unnecessary DEBUG_LOCKS_WARN_ON()
  2019-05-30 11:59 [PATCH] locking/lockdep: Remove unnecessary DEBUG_LOCKS_WARN_ON() Kobe Wu
       [not found] ` <1559217575-30298-1-git-send-email-kobe-cp.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
@ 2019-06-17 14:18 ` tip-bot for Kobe Wu
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Kobe Wu @ 2019-06-17 14:18 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, will.deacon, hpa, tglx, kobe-cp.wu, eason-yh.lin,
	mingo, torvalds, peterz, linux-mediatek, wsd_upstream

Commit-ID:  dd471efe345bf6f9e1206f6c629ca3e80eb43523
Gitweb:     https://git.kernel.org/tip/dd471efe345bf6f9e1206f6c629ca3e80eb43523
Author:     Kobe Wu <kobe-cp.wu@mediatek.com>
AuthorDate: Thu, 30 May 2019 19:59:35 +0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 17 Jun 2019 12:09:37 +0200

locking/lockdep: Remove unnecessary DEBUG_LOCKS_WARN_ON()

DEBUG_LOCKS_WARN_ON() will turn off debug_locks and
makes print_unlock_imbalance_bug() return directly.

Remove a redundant whitespace.

Signed-off-by: Kobe Wu <kobe-cp.wu@mediatek.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: <linux-mediatek@lists.infradead.org>
Cc: <wsd_upstream@mediatek.com>
Cc: Eason Lin <eason-yh.lin@mediatek.com>
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: https://lkml.kernel.org/r/1559217575-30298-1-git-send-email-kobe-cp.wu@mediatek.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/locking/lockdep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 48a840adb281..5e368f485330 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -4160,7 +4160,7 @@ __lock_release(struct lockdep_map *lock, unsigned long ip)
 	 * So we're all set to release this lock.. wait what lock? We don't
 	 * own any locks, you've been drinking again?
 	 */
-	if (DEBUG_LOCKS_WARN_ON(depth <= 0)) {
+	if (depth <= 0) {
 		print_unlock_imbalance_bug(curr, lock, ip);
 		return 0;
 	}

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

end of thread, other threads:[~2019-06-17 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-30 11:59 [PATCH] locking/lockdep: Remove unnecessary DEBUG_LOCKS_WARN_ON() Kobe Wu
     [not found] ` <1559217575-30298-1-git-send-email-kobe-cp.wu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2019-06-05 12:46   ` Will Deacon
     [not found]     ` <20190605124633.GM15030-UDVVEH7NWB15pKCnmE3YQBJ8xKzm50AiAL8bYrjMMd8@public.gmane.org>
2019-06-05 13:35       ` Peter Zijlstra
2019-06-17 14:18 ` [tip:locking/core] " tip-bot for Kobe Wu

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