lkml.org 
[lkml]   [2006]   [Jun]   [23]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateFri, 23 Jun 2006 09:57:13 +0200
FromIngo Molnar <>
SubjectRe: [patch] increase spinlock-debug looping timeouts (write_lock and NMI)
* Dave Olson <olson@unixfolk.com> 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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-06-23 10:05    [from the cache]
©2003-2008