Commit 8aa78d8d authored by Gregory Haskins's avatar Gregory Haskins Committed by Greg Kroah-Hartman

lockdep: fix mismatched lockdep_depth/curr_chain_hash

patch 3aa416b0 in mainline.

lockdep: fix mismatched lockdep_depth/curr_chain_hash

It is possible for the current->curr_chain_key to become inconsistent with the
current index if the chain fails to validate.  The end result is that future
lock_acquire() operations may inadvertently fail to find a hit in the cache
resulting in a new node being added to the graph for every acquire.

[ peterz: this might explain some of the lockdep is so _slow_ complaints. ]
[ mingo: this does not impact the correctness of validation, but may slow
  down future operations significantly, if the chain gets very long. ]
Signed-off-by: default avatarGregory Haskins <ghaskins@novell.com>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 02d29bbe
......@@ -2166,7 +2166,6 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
}
#endif
chain_key = iterate_chain_key(chain_key, id);
curr->curr_chain_key = chain_key;
/*
* Trylock needs to maintain the stack of held locks, but it
......@@ -2215,6 +2214,7 @@ static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass,
if (unlikely(!debug_locks))
return 0;
curr->curr_chain_key = chain_key;
curr->lockdep_depth++;
check_chain_key(curr);
#ifdef CONFIG_DEBUG_LOCKDEP
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment