diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-12-13 03:34:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 12:05:50 -0500 |
commit | 81fc685a898f84d0787eeebb1c118de0bd3484a0 (patch) | |
tree | f604565b228c12b3db6037673870882c8022c4a9 | |
parent | a664089741aa9010333ecbdadbf5d9de62bafa2d (diff) |
[PATCH] lockdep: improve verbose messages
Make verbose lockdep messages (off by default) more informative by printing
out the hash chain key. (this patch was what helped me catch the earlier
lockdep hash-collision bug)
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | kernel/lockdep.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 5d69c7d7407e..5ba2825bd46a 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -1264,7 +1264,7 @@ out_unlock_set: | |||
1264 | * add it and return 0 - in this case the new dependency chain is | 1264 | * add it and return 0 - in this case the new dependency chain is |
1265 | * validated. If the key is already hashed, return 1. | 1265 | * validated. If the key is already hashed, return 1. |
1266 | */ | 1266 | */ |
1267 | static inline int lookup_chain_cache(u64 chain_key) | 1267 | static inline int lookup_chain_cache(u64 chain_key, struct lock_class *class) |
1268 | { | 1268 | { |
1269 | struct list_head *hash_head = chainhashentry(chain_key); | 1269 | struct list_head *hash_head = chainhashentry(chain_key); |
1270 | struct lock_chain *chain; | 1270 | struct lock_chain *chain; |
@@ -1286,9 +1286,13 @@ cache_hit: | |||
1286 | __raw_spin_lock(&hash_lock); | 1286 | __raw_spin_lock(&hash_lock); |
1287 | return 1; | 1287 | return 1; |
1288 | #endif | 1288 | #endif |
1289 | if (very_verbose(class)) | ||
1290 | printk("\nhash chain already cached, key: %016Lx tail class: [%p] %s\n", chain_key, class->key, class->name); | ||
1289 | return 0; | 1291 | return 0; |
1290 | } | 1292 | } |
1291 | } | 1293 | } |
1294 | if (very_verbose(class)) | ||
1295 | printk("\nnew hash chain, key: %016Lx tail class: [%p] %s\n", chain_key, class->key, class->name); | ||
1292 | /* | 1296 | /* |
1293 | * Allocate a new chain entry from the static array, and add | 1297 | * Allocate a new chain entry from the static array, and add |
1294 | * it to the hash: | 1298 | * it to the hash: |
@@ -2139,7 +2143,7 @@ out_calc_hash: | |||
2139 | * (If lookup_chain_cache() returns with 1 it acquires | 2143 | * (If lookup_chain_cache() returns with 1 it acquires |
2140 | * hash_lock for us) | 2144 | * hash_lock for us) |
2141 | */ | 2145 | */ |
2142 | if (!trylock && (check == 2) && lookup_chain_cache(chain_key)) { | 2146 | if (!trylock && (check == 2) && lookup_chain_cache(chain_key, class)) { |
2143 | /* | 2147 | /* |
2144 | * Check whether last held lock: | 2148 | * Check whether last held lock: |
2145 | * | 2149 | * |