Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=81fc685a898f84d0787eeebb1c118de0bd3484a0
Commit:     81fc685a898f84d0787eeebb1c118de0bd3484a0
Parent:     a664089741aa9010333ecbdadbf5d9de62bafa2d
Author:     Ingo Molnar <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 13 00:34:40 2006 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Dec 13 09:05:50 2006 -0800

    [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 <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 kernel/lockdep.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 5d69c7d..5ba2825 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -1264,7 +1264,7 @@ out_unlock_set:
  * add it and return 0 - in this case the new dependency chain is
  * validated. If the key is already hashed, return 1.
  */
-static inline int lookup_chain_cache(u64 chain_key)
+static inline int lookup_chain_cache(u64 chain_key, struct lock_class *class)
 {
        struct list_head *hash_head = chainhashentry(chain_key);
        struct lock_chain *chain;
@@ -1286,9 +1286,13 @@ cache_hit:
                        __raw_spin_lock(&hash_lock);
                        return 1;
 #endif
+                       if (very_verbose(class))
+                               printk("\nhash chain already cached, key: 
%016Lx tail class: [%p] %s\n", chain_key, class->key, class->name);
                        return 0;
                }
        }
+       if (very_verbose(class))
+               printk("\nnew hash chain, key: %016Lx tail class: [%p] %s\n", 
chain_key, class->key, class->name);
        /*
         * Allocate a new chain entry from the static array, and add
         * it to the hash:
@@ -2139,7 +2143,7 @@ out_calc_hash:
         * (If lookup_chain_cache() returns with 1 it acquires
         * hash_lock for us)
         */
-       if (!trylock && (check == 2) && lookup_chain_cache(chain_key)) {
+       if (!trylock && (check == 2) && lookup_chain_cache(chain_key, class)) {
                /*
                 * Check whether last held lock:
                 *
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to