Re: printk while interrupts are disabled

From: Andrew Morton (akpm@zip.com.au)
Date: Tue Oct 02 2001 - 12:09:48 EST


Crutcher Dunnavant wrote:
>
> ++ 02/10/01 13:37 +0200 - Norbert Roos:
> > Hello!
> >
> > Simple question: Do printk()s get printed while interrupts are disabled
> > (after cli)?
>
> They get stuffed into a buffer to be printed later. It is possible to
> overflow that buffer, and lose some of your printk messages.

Not quite - a printk from cli() or hardirq context will normally
come out immediately. The only time the deferred buffering
thing happens is if the console semaphore is found to be already held on
entry to printk(). ie: there is already a printk in progress on another CPU
or on this CPU in non-interrupt context.

The buffered printk output will be printed by the current console-sem
owner before it releases the semaphore.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Oct 07 2001 - 21:00:22 EST