Merge branch 'devel' into for-linus
[sfrench/cifs-2.6.git] / lib / spinlock_debug.c
index b6c4f898197c52f0b175ad0ea9e26466c338ea30..9c4b0256490bd240b37f8811915e873463c88537 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <linux/spinlock.h>
+#include <linux/nmi.h>
 #include <linux/interrupt.h>
 #include <linux/debug_locks.h>
 #include <linux/delay.h>
@@ -59,12 +60,12 @@ static void spin_bug(spinlock_t *lock, const char *msg)
                owner = lock->owner;
        printk(KERN_EMERG "BUG: spinlock %s on CPU#%d, %s/%d\n",
                msg, raw_smp_processor_id(),
-               current->comm, current->pid);
+               current->comm, task_pid_nr(current));
        printk(KERN_EMERG " lock: %p, .magic: %08x, .owner: %s/%d, "
                        ".owner_cpu: %d\n",
                lock, lock->magic,
                owner ? owner->comm : "<none>",
-               owner ? owner->pid : -1,
+               owner ? task_pid_nr(owner) : -1,
                lock->owner_cpu);
        dump_stack();
 }
@@ -115,8 +116,11 @@ static void __spin_lock_debug(spinlock_t *lock)
                        printk(KERN_EMERG "BUG: spinlock lockup on CPU#%d, "
                                        "%s/%d, %p\n",
                                raw_smp_processor_id(), current->comm,
-                               current->pid, lock);
+                               task_pid_nr(current), lock);
                        dump_stack();
+#ifdef CONFIG_SMP
+                       trigger_all_cpu_backtrace();
+#endif
                }
        }
 }
@@ -157,7 +161,7 @@ static void rwlock_bug(rwlock_t *lock, const char *msg)
 
        printk(KERN_EMERG "BUG: rwlock %s on CPU#%d, %s/%d, %p\n",
                msg, raw_smp_processor_id(), current->comm,
-               current->pid, lock);
+               task_pid_nr(current), lock);
        dump_stack();
 }