From fd0a37355c4d39affa39d5cd75168fb94b292318 Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Tue, 29 May 2012 15:07:34 -0700 Subject: spinlock_debug: print kallsyms name for lock When a spinlock warning is printed we usually get BUG: spinlock bad magic on CPU#0, modprobe/111 lock: 0xdff09f38, .magic: 00000000, .owner: /0, .owner_cpu: 0 but it's nicer to print the symbol for the lock if we have it so that we can avoid 'grep dff09f38 /proc/kallsyms' to find out which lock it was. Use kallsyms to print the symbol name so we get something a bit easier to read BUG: spinlock bad magic on CPU#0, modprobe/112 lock: test_lock, .magic: 00000000, .owner: /-1, .owner_cpu: 0 If the lock is not in kallsyms %ps will fall back to printing the address directly. Signed-off-by: Stephen Boyd Cc: Ingo Molnar Cc: Peter Zijlstra Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- lib/spinlock_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/spinlock_debug.c') diff --git a/lib/spinlock_debug.c b/lib/spinlock_debug.c index 525d160d44f0..d0ec4f3d1593 100644 --- a/lib/spinlock_debug.c +++ b/lib/spinlock_debug.c @@ -58,7 +58,7 @@ static void spin_dump(raw_spinlock_t *lock, const char *msg) printk(KERN_EMERG "BUG: spinlock %s on CPU#%d, %s/%d\n", msg, raw_smp_processor_id(), current->comm, task_pid_nr(current)); - printk(KERN_EMERG " lock: %p, .magic: %08x, .owner: %s/%d, " + printk(KERN_EMERG " lock: %ps, .magic: %08x, .owner: %s/%d, " ".owner_cpu: %d\n", lock, lock->magic, owner ? owner->comm : "", -- cgit v1.2.3-59-g8ed1b From 8a173b1476d126674104c7c5c6cef0bcd824b001 Mon Sep 17 00:00:00 2001 From: Christian Borntraeger Date: Tue, 29 May 2012 11:18:44 +0200 Subject: spinlock: Indicate that a lockup is only suspected On an over-committed KVM system we got a: "BUG: spinlock lockup on CPU#2, swapper/2/0" message on the heavily contended virtio blk spinlock. While we might want to reconsider the locking of virtio-blk (lock is held while switching to the host) this patch tries to make the message clearer: the lockup is only suspected. Signed-off-by: Christian Borntraeger Cc: Rusty Russell Cc: Michael S. Tsirkin Cc: Linus Torvalds Cc: Andrew Morton Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1338283124-7063-1-git-send-email-borntraeger@de.ibm.com Signed-off-by: Ingo Molnar --- lib/spinlock_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/spinlock_debug.c') diff --git a/lib/spinlock_debug.c b/lib/spinlock_debug.c index d0ec4f3d1593..e91fbc23fff1 100644 --- a/lib/spinlock_debug.c +++ b/lib/spinlock_debug.c @@ -118,7 +118,7 @@ static void __spin_lock_debug(raw_spinlock_t *lock) /* lockup suspected: */ if (print_once) { print_once = 0; - spin_dump(lock, "lockup"); + spin_dump(lock, "lockup suspected"); #ifdef CONFIG_SMP trigger_all_cpu_backtrace(); #endif -- cgit v1.2.3-59-g8ed1b