Re: [PATCH][BUG] Badness in smp_call_function at arch/i386/kernel/smp.c:552

From: Zwane Mwaikambo
Date: Fri Dec 03 2004 - 02:46:09 EST


On Thu, 2 Dec 2004, Andrew Morton wrote:

> > > However enabling interrupts as you've done menas that theoretically we
> > > could deadlock on sysrq_key_table_lock if another sysrq happens at the
> > > wrong time.
> > >
> > > Which deadlock opportunity would you prefer? ;)
> >
> > Agreed, there is actually a higher chance of the smp_call_function
> > deadlock occuring since the __handle_sysrq one relies on another sysrq
> > event occuring via a different IRQ line interrupt handler, so
> > we would have to do sysrq via serial and then sysrq via keyboard to cause
> > the deadlock. Perhaps just make it a spin_trylock?
>
> Well yeah, but it's so much fuss for such a silly problem.
>
> How about a local_irq_enable() in sysrq_handle_reboot()?

That should be fine too, i prefer it to local_irq_enable in
machine_shutdown() too.

Signed-off-by: Zwane Mwaikambo <zwane@xxxxxxxxxxxxxx>

===== drivers/char/sysrq.c 1.32 vs edited =====
--- 1.32/drivers/char/sysrq.c 2004-11-07 19:13:54 -07:00
+++ edited/drivers/char/sysrq.c 2004-12-03 00:42:29 -07:00
@@ -98,6 +98,7 @@ static struct sysrq_key_op sysrq_unraw_o
static void sysrq_handle_reboot(int key, struct pt_regs *pt_regs,
struct tty_struct *tty)
{
+ local_irq_enable();
machine_restart(NULL);
}

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