Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.25-rc7 /kernel/lockdep.c

Filename:/kernel/lockdep.c
Lines Added:15
Lines Deleted:5
Also changed in: (Previous) 2.6.25-rc6  2.6.25-rc5  2.6.25-rc4  2.6.25-rc3-git6  2.6.25-rc3-git5  2.6.25-rc3-git4 
(Following) 2.6.25-rc8  2.6.25-rc9  2.6.25  2.6.26-git1  2.6.26-git2  2.6.26-git3 

Location
[  2.6.25-rc7
  [  kernel
     o  lockdep.c

Patch

diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index e2c07ec..81a4e4a 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -779,6 +779,10 @@ register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force)
     * parallel walking of the hash-list safe:
     */
    list_add_tail_rcu(&class->hash_entry, hash_head);
+   /*
+    * Add it to the global list of classes:
+    */
+   list_add_tail_rcu(&class->lock_entry, &all_lock_classes);
 
    if (verbose(class)) {
       graph_unlock();
@@ -2282,10 +2286,6 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this,
          return 0;
       break;
    case LOCK_USED:
-      /*
-       * Add it to the global list of classes:
-       */
-      list_add_tail_rcu(&this->class->lock_entry, &all_lock_classes);
       debug_atomic_dec(&nr_unused_locks);
       break;
    default:
@@ -3206,7 +3206,11 @@ retry:
 
 EXPORT_SYMBOL_GPL(debug_show_all_locks);
 
-void debug_show_held_locks(struct task_struct *task)
+/*
+ * Careful: only use this function if you are sure that
+ * the task cannot run in parallel!
+ */
+void __debug_show_held_locks(struct task_struct *task)
 {
    if (unlikely(!debug_locks)) {
       printk("INFO: lockdep is turned off.\n");
@@ -3214,6 +3218,12 @@ void debug_show_held_locks(struct task_struct *task)
    }
    lockdep_print_held_locks(task);
 }
+EXPORT_SYMBOL_GPL(__debug_show_held_locks);
+
+void debug_show_held_locks(struct task_struct *task)
+{
+      __debug_show_held_locks(task);
+}
 
 EXPORT_SYMBOL_GPL(debug_show_held_locks);
 


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.