Re: combinatorial explosion in lockdep

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Miller <davem@...>
Cc: <mingo@...>, <peterz@...>, <linux-kernel@...>
Date: Monday, August 4, 2008 - 8:21 am

On Sun, 3 Aug 2008, David Miller wrote:

Ah, so it was intentional that your patch set oops_in_progess without
ever clearing it again.  Hmm.  I think I'd reword your "probably best"
to "arguably best".  If everything really locks up at this point, then
there is no point to clearing oops_in_progress after; but if the system
manages to resume (arguably) normal operation after, then leaving it
forever oops_in_progess worries me, and differs from current practice.

I think I'd rather clear it afterwards in any public patch; but edit
that out privately if it helps while debugging some particular problem.
I did try to reproduce my spinlock lockups yesterday, but without
success, so have no practical experience one way or the other.

But notice that I shouldn't be messing directly with oops_in_progress:
better to use bust_spinlocks() (oops_in_progress++/-- and wake klogd).

[PATCH] bust_spinlocks while reporting spinlock lockup

Use bust_spinlocks() while reporting spinlock lockup to avoid deadlock
inside printk() or the backtraces.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
---

 lib/spinlock_debug.c |    2 ++
 1 file changed, 2 insertions(+)

--- 2.6.27-rc1/lib/spinlock_debug.c	2008-01-24 22:58:37.000000000 +0000
+++ linux/lib/spinlock_debug.c	2008-08-01 12:41:52.000000000 +0100
@@ -113,6 +113,7 @@ static void __spin_lock_debug(spinlock_t
 		/* lockup suspected: */
 		if (print_once) {
 			print_once = 0;
+			bust_spinlocks(1);
 			printk(KERN_EMERG "BUG: spinlock lockup on CPU#%d, "
 					"%s/%d, %p\n",
 				raw_smp_processor_id(), current->comm,
@@ -121,6 +122,7 @@ static void __spin_lock_debug(spinlock_t
 #ifdef CONFIG_SMP
 			trigger_all_cpu_backtrace();
 #endif
+			bust_spinlocks(0);
 		}
 	}
 }
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
combinatorial explosion in lockdep, David Miller, (Mon Jul 28, 6:37 pm)
Re: combinatorial explosion in lockdep, David Miller, (Mon Jul 28, 7:13 pm)
Re: combinatorial explosion in lockdep, Ingo Molnar, (Mon Jul 28, 7:51 pm)
Re: combinatorial explosion in lockdep, David Miller, (Mon Jul 28, 8:44 pm)
Re: combinatorial explosion in lockdep, David Miller, (Wed Jul 30, 12:45 am)
Re: combinatorial explosion in lockdep, Ingo Molnar, (Thu Jul 31, 12:39 pm)
Re: combinatorial explosion in lockdep, Ingo Molnar, (Fri Aug 1, 5:22 am)
Re: combinatorial explosion in lockdep, David Miller, (Fri Aug 1, 5:32 am)
Re: combinatorial explosion in lockdep, Hugh Dickins, (Fri Aug 1, 7:57 am)
Re: combinatorial explosion in lockdep, David Miller, (Sun Aug 3, 4:14 am)
Re: combinatorial explosion in lockdep, Hugh Dickins, (Mon Aug 4, 8:21 am)
[PATCH] lockdep: change scheduler annotation, Peter Zijlstra, (Wed Jul 30, 7:26 am)
Re: [PATCH] lockdep: change scheduler annotation, Ingo Molnar, (Thu Jul 31, 12:34 pm)
Re: [PATCH] lockdep: change scheduler annotation, David Miller, (Wed Jul 30, 7:34 am)
Re: combinatorial explosion in lockdep, Peter Zijlstra, (Wed Jul 30, 7:15 am)
Re: [stable] combinatorial explosion in lockdep, Greg KH, (Thu Jul 31, 12:50 pm)
Re: combinatorial explosion in lockdep, Peter Zijlstra, (Wed Jul 30, 3:19 am)
Re: combinatorial explosion in lockdep, David Miller, (Wed Jul 30, 2:56 am)
Re: combinatorial explosion in lockdep, Peter Zijlstra, (Wed Jul 30, 3:21 am)
Re: combinatorial explosion in lockdep, Jeremy Fitzhardinge, (Mon Jul 28, 6:50 pm)
Re: combinatorial explosion in lockdep, David Miller, (Mon Jul 28, 6:56 pm)