All of lore.kernel.org
 help / color / mirror / Atom feed
* [tip:core/locking] lockdep: Fix lockdep_no_validate against IRQ states
@ 2011-07-21 19:32 tip-bot for Peter Zijlstra
  2011-07-29  3:38 ` Li Zefan
  0 siblings, 1 reply; 3+ messages in thread
From: tip-bot for Peter Zijlstra @ 2011-07-21 19:32 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, a.p.zijlstra, tglx, mingo

Commit-ID:  efbe2eee6dc0f179be84292bf269528b3ec365e9
Gitweb:     http://git.kernel.org/tip/efbe2eee6dc0f179be84292bf269528b3ec365e9
Author:     Peter Zijlstra <a.p.zijlstra@chello.nl>
AuthorDate: Thu, 7 Jul 2011 11:39:45 +0200
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 21 Jul 2011 20:43:16 +0200

lockdep: Fix lockdep_no_validate against IRQ states

Thomas noticed that a lock marked with lockdep_set_novalidate_class()
will still trigger warnings for IRQ inversions. Cure this by skipping
those when marking irq state.

Reported-and-tested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-2dp5vmpsxeraqm42kgww6ge2@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/lockdep.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 298c927..628276d 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -2468,6 +2468,9 @@ mark_held_locks(struct task_struct *curr, enum mark_type mark)
 
 		BUG_ON(usage_bit >= LOCK_USAGE_STATES);
 
+		if (hlock_class(hlock)->key == &__lockdep_no_validate__)
+			continue;
+
 		if (!mark_lock(curr, hlock, usage_bit))
 			return 0;
 	}

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

* Re: [tip:core/locking] lockdep: Fix lockdep_no_validate against IRQ states
  2011-07-21 19:32 [tip:core/locking] lockdep: Fix lockdep_no_validate against IRQ states tip-bot for Peter Zijlstra
@ 2011-07-29  3:38 ` Li Zefan
  2011-07-29  5:54   ` Peter Zijlstra
  0 siblings, 1 reply; 3+ messages in thread
From: Li Zefan @ 2011-07-29  3:38 UTC (permalink / raw)
  To: a.p.zijlstra; +Cc: mingo, hpa, linux-kernel, tglx, mingo, linux-tip-commits

tip-bot for Peter Zijlstra wrote:
> Commit-ID:  efbe2eee6dc0f179be84292bf269528b3ec365e9
> Gitweb:     http://git.kernel.org/tip/efbe2eee6dc0f179be84292bf269528b3ec365e9
> Author:     Peter Zijlstra <a.p.zijlstra@chello.nl>
> AuthorDate: Thu, 7 Jul 2011 11:39:45 +0200
> Committer:  Ingo Molnar <mingo@elte.hu>
> CommitDate: Thu, 21 Jul 2011 20:43:16 +0200
> 
> lockdep: Fix lockdep_no_validate against IRQ states
> 
> Thomas noticed that a lock marked with lockdep_set_novalidate_class()
> will still trigger warnings for IRQ inversions. Cure this by skipping
> those when marking irq state.
> 
> Reported-and-tested-by: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> Link: http://lkml.kernel.org/n/tip-2dp5vmpsxeraqm42kgww6ge2@git.kernel.org
> Signed-off-by: Ingo Molnar <mingo@elte.hu>
> ---
>  kernel/lockdep.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/kernel/lockdep.c b/kernel/lockdep.c
> index 298c927..628276d 100644
> --- a/kernel/lockdep.c
> +++ b/kernel/lockdep.c
> @@ -2468,6 +2468,9 @@ mark_held_locks(struct task_struct *curr, enum mark_type mark)
>  
>  		BUG_ON(usage_bit >= LOCK_USAGE_STATES);
>  
> +		if (hlock_class(hlock)->key == &__lockdep_no_validate__)
> +			continue;
> +

The 2 pointers are not the same type.

kernel/lockdep.c: In function 'mark_held_locks':
kernel/lockdep.c:2471:31: warning: comparison of distinct pointer types lacks a cast

>  		if (!mark_lock(curr, hlock, usage_bit))
>  			return 0;
>  	}

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

* Re: [tip:core/locking] lockdep: Fix lockdep_no_validate against IRQ states
  2011-07-29  3:38 ` Li Zefan
@ 2011-07-29  5:54   ` Peter Zijlstra
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Zijlstra @ 2011-07-29  5:54 UTC (permalink / raw)
  To: Li Zefan; +Cc: mingo, hpa, linux-kernel, tglx, mingo, linux-tip-commits

On Fri, 2011-07-29 at 11:38 +0800, Li Zefan wrote:
> > +             if (hlock_class(hlock)->key ==
> &__lockdep_no_validate__)
> > +                     continue;
> > +
> 
> The 2 pointers are not the same type.
> 
> kernel/lockdep.c: In function 'mark_held_locks':
> kernel/lockdep.c:2471:31: warning: comparison of distinct pointer
> types lacks a cast

Yeah, I know, I've even got a fix queued up.. Thanks though.

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

end of thread, other threads:[~2011-07-29  5:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-21 19:32 [tip:core/locking] lockdep: Fix lockdep_no_validate against IRQ states tip-bot for Peter Zijlstra
2011-07-29  3:38 ` Li Zefan
2011-07-29  5:54   ` Peter Zijlstra

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.