aboutsummaryrefslogtreecommitdiffstats
path: root/lib/spinlock_debug.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-10-17 08:32:49 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-17 08:32:49 -0400
commit214e2ca2b82d335935a861c253fe94c61ad77aad (patch)
treeeee42ff74d10470789d919b8499737ad0e919360 /lib/spinlock_debug.c
parent1fdead8ad31d3aa833bc37739273fcde89ace93c (diff)
parentddffeb8c4d0331609ef2581d84de4d763607bd37 (diff)
Merge tag 'v3.7-rc1' into staging/for_v3.8
Linux 3.7-rc1 * tag 'v3.7-rc1': (9579 commits) Linux 3.7-rc1 x86, boot: Explicitly include autoconf.h for hostprogs perf: Fix UAPI fallout ARM: config: make sure that platforms are ordered by option string ARM: config: sort select statements alphanumerically UAPI: (Scripted) Disintegrate include/linux/byteorder UAPI: (Scripted) Disintegrate include/linux UAPI: Unexport linux/blk_types.h UAPI: Unexport part of linux/ppp-comp.h perf: Handle new rbtree implementation procfs: don't need a PATH_MAX allocation to hold a string representation of an int vfs: embed struct filename inside of names_cache allocation if possible audit: make audit_inode take struct filename vfs: make path_openat take a struct filename pointer vfs: turn do_path_lookup into wrapper around struct filename variant audit: allow audit code to satisfy getname requests from its names_list vfs: define struct filename and have getname() return it btrfs: Fix compilation with user namespace support enabled userns: Fix posix_acl_file_xattr_userns gid conversion userns: Properly print bluetooth socket uids ...
Diffstat (limited to 'lib/spinlock_debug.c')
-rw-r--r--lib/spinlock_debug.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/lib/spinlock_debug.c b/lib/spinlock_debug.c
index eb10578ae055..0374a596cffa 100644
--- a/lib/spinlock_debug.c
+++ b/lib/spinlock_debug.c
@@ -107,23 +107,27 @@ static void __spin_lock_debug(raw_spinlock_t *lock)
107{ 107{
108 u64 i; 108 u64 i;
109 u64 loops = loops_per_jiffy * HZ; 109 u64 loops = loops_per_jiffy * HZ;
110 int print_once = 1;
111 110
112 for (;;) { 111 for (i = 0; i < loops; i++) {
113 for (i = 0; i < loops; i++) { 112 if (arch_spin_trylock(&lock->raw_lock))
114 if (arch_spin_trylock(&lock->raw_lock)) 113 return;
115 return; 114 __delay(1);
116 __delay(1); 115 }
117 } 116 /* lockup suspected: */
118 /* lockup suspected: */ 117 spin_dump(lock, "lockup suspected");
119 if (print_once) {
120 print_once = 0;
121 spin_dump(lock, "lockup suspected");
122#ifdef CONFIG_SMP 118#ifdef CONFIG_SMP
123 trigger_all_cpu_backtrace(); 119 trigger_all_cpu_backtrace();
124#endif 120#endif
125 } 121
126 } 122 /*
123 * The trylock above was causing a livelock. Give the lower level arch
124 * specific lock code a chance to acquire the lock. We have already
125 * printed a warning/backtrace at this point. The non-debug arch
126 * specific code might actually succeed in acquiring the lock. If it is
127 * not successful, the end-result is the same - there is no forward
128 * progress.
129 */
130 arch_spin_lock(&lock->raw_lock);
127} 131}
128 132
129void do_raw_spin_lock(raw_spinlock_t *lock) 133void do_raw_spin_lock(raw_spinlock_t *lock)