Re: [patch] increase spinlock-debug looping timeouts (write_lock and NMI)

From: Ingo Molnar
Date: Fri Jun 23 2006 - 04:03:13 EST



* Dave Olson <olson@xxxxxxxxxxxx> wrote:

> | > CONFIG_DEBUG_SPINLOCK=y
> | > CONFIG_DEBUG_SPINLOCK_SLEEP=y
> | It would be super-interesting to know whether
> | CONFIG_DEBUG_SPINLOCK=n improves things.
>
> It does. No stalls, hangs, or nmi's in several hours of running the
> test that previously failed on almost every run (with long stalls,
> system hangs, or NMI watchdogs), on the same hardware.
>
> I made no other changes to the kernel config than turning both of the
> above off.

we really need to figure out what's happening here! Could you re-enable
spinlock debugging and try the patch below - do the stalls/lockups still
happen?

Ingo

---
lib/spinlock_debug.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

Index: linux/lib/spinlock_debug.c
===================================================================
--- linux.orig/lib/spinlock_debug.c
+++ linux/lib/spinlock_debug.c
@@ -104,10 +104,10 @@ static void __spin_lock_debug(spinlock_t
u64 i;

for (;;) {
- for (i = 0; i < loops_per_jiffy * HZ; i++) {
+ for (;;) {
if (__raw_spin_trylock(&lock->raw_lock))
return;
- __delay(1);
+ cpu_relax();
}
/* lockup suspected: */
if (print_once) {
@@ -169,10 +169,10 @@ static void __read_lock_debug(rwlock_t *
u64 i;

for (;;) {
- for (i = 0; i < loops_per_jiffy * HZ; i++) {
+ for (;;) {
if (__raw_read_trylock(&lock->raw_lock))
return;
- __delay(1);
+ cpu_relax();
}
/* lockup suspected: */
if (print_once) {
@@ -242,10 +242,10 @@ static void __write_lock_debug(rwlock_t
u64 i;

for (;;) {
- for (i = 0; i < loops_per_jiffy * HZ; i++) {
+ for (;;) {
if (__raw_write_trylock(&lock->raw_lock))
return;
- __delay(1);
+ cpu_relax();
}
/* lockup suspected: */
if (print_once) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/