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

From: Andrew Morton (andrewm@uow.edu.au)
Date: Sat Jul 01 2000 - 11:18:51 EDT

  • Next message: Chris Wedgwood: "fork then wait4 bug when being traced?"

    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/



    This archive was generated by hypermail 2b29 : Sat Jul 01 2000 - 11:20:06 EDT