Skip to content

Commit

Permalink
[PATCH] lockdep: improve lockdep_reset()
Browse files Browse the repository at this point in the history
Clear all the chains during lockdep_reset().  This fixes some locking-selftest
false positives i saw on -rt.  (never saw those on mainline though, but it
could happen.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Ingo Molnar authored and Linus Torvalds committed Dec 13, 2006
1 parent 81fc685 commit 23d95a0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kernel/lockdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -2437,6 +2437,7 @@ EXPORT_SYMBOL_GPL(lock_release);
void lockdep_reset(void)
{
unsigned long flags;
int i;

raw_local_irq_save(flags);
current->curr_chain_key = 0;
Expand All @@ -2447,6 +2448,8 @@ void lockdep_reset(void)
nr_softirq_chains = 0;
nr_process_chains = 0;
debug_locks = 1;
for (i = 0; i < CHAINHASH_SIZE; i++)
INIT_LIST_HEAD(chainhash_table + i);
raw_local_irq_restore(flags);
}

Expand Down

0 comments on commit 23d95a0

Please sign in to comment.