Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330091
b: refs/heads/master
c: 214f766
h: refs/heads/master
i:
  330089: 1a41040
  330087: 4bf0252
v: v3
  • Loading branch information
Vikram Mulukutla authored and Linus Torvalds committed Oct 5, 2012
1 parent 923d30b commit a81f564
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ca279cf1065fb689abea1dc7d8c11787729bb185
refs/heads/master: 214f766ea0909e743122966c4617b3a112e405d7
32 changes: 18 additions & 14 deletions trunk/lib/spinlock_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,27 @@ static void __spin_lock_debug(raw_spinlock_t *lock)
{
u64 i;
u64 loops = loops_per_jiffy * HZ;
int print_once = 1;

for (;;) {
for (i = 0; i < loops; i++) {
if (arch_spin_trylock(&lock->raw_lock))
return;
__delay(1);
}
/* lockup suspected: */
if (print_once) {
print_once = 0;
spin_dump(lock, "lockup suspected");
for (i = 0; i < loops; i++) {
if (arch_spin_trylock(&lock->raw_lock))
return;
__delay(1);
}
/* lockup suspected: */
spin_dump(lock, "lockup suspected");
#ifdef CONFIG_SMP
trigger_all_cpu_backtrace();
trigger_all_cpu_backtrace();
#endif
}
}

/*
* The trylock above was causing a livelock. Give the lower level arch
* specific lock code a chance to acquire the lock. We have already
* printed a warning/backtrace at this point. The non-debug arch
* specific code might actually succeed in acquiring the lock. If it is
* not successful, the end-result is the same - there is no forward
* progress.
*/
arch_spin_lock(&lock->raw_lock);
}

void do_raw_spin_lock(raw_spinlock_t *lock)
Expand Down

0 comments on commit a81f564

Please sign in to comment.