Re: combinatorial explosion in lockdep

From: Hugh Dickins
Date: Fri Aug 01 2008 - 07:58:18 EST


On Fri, 1 Aug 2008, David Miller wrote:
>
> I think a non-trivial number of people hit that printk deadlock bug,
> but just didn't report it because the machine essentially hard hangs
> silently. At best you'd see the:
>
> ========================================
>
> initial line from lockdep, but often even that doesn't make it to the
> console.

Not just with lockdep. A couple of months back CONFIG_DEBUG_SPINLOCK
was giving me spinlock debug messages under load on x86_64 duo laptop,
but hung up before showing the intended backtrace. I added the patch
below, but IIRC shifted over to other issues (and switched from cfq to
anticipatory scheduler, which made a difference) before finding out if
this patch really helped. If it makes sense to you, please add it in.

Hugh

[PATCH] set oops_in_progress for spinlock lockup

Set oops_in_progress while reporting spinlock lockup,
to avoid deadlock inside printk() or the backtraces.

Signed-off-by: Hugh Dickins <hugh@xxxxxxxxxxx>
---

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;
+ oops_in_progress = 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
+ oops_in_progress = 0;
}
}
}
--
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/