lockdep: Fix lockdep_no_validate against IRQ states
Commit-ID: efbe2eee6dc0f179be84292bf269528b3ec365e9 Gitweb: http://git.kernel.org/tip/efbe2eee6dc0f179be84292bf269528b3ec365e9 Author: Peter Zijlstra <[email protected]> AuthorDate: Thu, 7 Jul 2011 11:39:45 +0200 Committer: Ingo Molnar <[email protected]> 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.
--- kernel/lockdep.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
kernel/lockdep.c +3 -0
@@ -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 ; }
Quoted 26 lines · tip-bot for Peter Zijlstra
Commit-ID: efbe2eee6dc0f179be84292bf269528b3ec365e9 Gitweb: http://git.kernel.org/tip/efbe2eee6dc0f179be84292bf269528b3ec365e9 Author: Peter Zijlstra <[email protected]> AuthorDate: Thu, 7 Jul 2011 11:39:45 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 21 Jul 2011 20:43:16 +0200lockdep: Fix
lockdep_no_validateagainst IRQ statesThomas 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 <[email protected]>Signed-off-by Peter Zijlstra <[email protected]>Signed-off-by Ingo Molnar <[email protected]>--- kernel/lockdep.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)kernel/lockdep.c +0
-0
kernel/lockdep.c mark_held_locks(struct task_struct *curr, enum mark_type mark) · line 2473
Quoted 6 lines
kernel/lockdep.c +3
-0@@ -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
Quoted 3 lines
kernel/lockdep.c +0
-0if (!mark_lock (curr, hlock, usage_bit))return 0 ; }
Quoted 10 lines · Li Zefan
Quoted 1 line
+ if (hlock_class(hlock)->key ==
&__lockdep_no_validate__)kernel/lockdep.c mark_held_locks(struct task_struct *curr, enum mark_type mark) · line 2473
Quoted 2 lines
kernel/lockdep.c +2
-0+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.