Re: [PATCH] Make printk lock when appropriate...

Andrew Morton (andrewm@uow.edu.au)
Sun, 02 Jul 2000 01:18:51 +1000


Keith Owens wrote:
>
> What about this code instead of spin_lock_irqsave? Pity we do not have
> spin_trylock_irqsave();
>
> local_irq_save(flags);
> if (!spin_trylock(&console_lock)) {
> local_irq_restore(flags);
> return(0);
> }

If somebody tries to call printk with console_lock held then something
very bad is happening. That message wants to come out.

I suggest that rather than returning we should bust the spinlock, as is
done in the NMI handler (arch/i386/kernel/traps.c). Move that code to
printk.

And let's move that dopey `buf' declaration inside printk() and make it
static.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/