Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23d95a03 authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds
Browse files

[PATCH] lockdep: improve lockdep_reset()



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: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 81fc685a
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -2437,6 +2437,7 @@ EXPORT_SYMBOL_GPL(lock_release);
void lockdep_reset(void)
void lockdep_reset(void)
{
{
	unsigned long flags;
	unsigned long flags;
	int i;


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