Re: [patch] spinlock-debug fix

From: Reuben Farrelly
Date: Mon Jun 27 2005 - 05:58:23 EST


Hi,

On 27/06/2005 9:48 p.m., Ingo Molnar wrote:
* Andrew Morton <akpm@xxxxxxxx> wrote:

Reuben Farrelly <reuben-lkml@xxxxxxxx> wrote:
> Anyway, scary trace. It look like some spinlock is thought to be in the
> wrong state in schedule(). Send the .config, please.

Now online at http://www.reub.net/kernel/.config
Me too.

BUG: spinlock recursion on CPU#0, swapper/0, c120d520 [<c01039ed>] dump_stack+0x19/0x20 [<c01d9af2>] spin_bug+0x42/0x54 [<c01d9bfa>] _raw_spin_lock+0x3e/0x84
[<c031d0ad>] _spin_lock+0x9/0x10 [<c031b9e9>] schedule+0x479/0xbc8
[<c0100cb4>] cpu_idle+0x88/0x8c [<c01002c1>] rest_init+0x21/0x28
[<c0442899>] start_kernel+0x151/0x158
[<c010020f>] 0xc010020f Kernel panic - not syncing: bad locking

The bug is in the new spinlock debugging code itself. Ingo, can you test that .config please?

couldnt reproduce it on an UP box, nor on an SMP/HT 2/4-way box, but it finally triggered on a 2-way SMP box.

the bug is that current->pid is not a unique identifier on SMP (doh!).

The patch below fixes the bug - which also happens to be a speedup for the debugging code, as the ->pid dereferencing does not have to be done anymore. Also, i've disabled the panicing for now.

Ingo

This patch fixes it - thanks Ingo.

reuben
-
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/