[lkml]   [2001]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: printk while interrupts are disabled
++ 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.

from krenel/printk.c:
* This is printk. It can be called from any context. We want it to
* work.
* We try to grab the console_sem. If we succeed, it's easy - we log
* the output and
* call the console drivers. If we fail to get the semaphore we place
* the output
* into the log buffer and return. The current holder of the
* console_sem will
* notice the new output in release_console_sem() and will send it to
* the
* consoles before releasing the semaphore.
* One effect of this deferred printing is that code which calls
* printk() and
* then changes console_loglevel may break. This is because
* console_loglevel
* is inspected when the actual printing occurs.
/* This stops the holder of console_sem just where we want him
* */
spin_lock_irqsave(&logbuf_lock, flags);

Crutcher <>
GCS d--- s+:>+:- a-- C++++$ UL++++$ L+++$>++++ !E PS+++ PE Y+ PGP+>++++
R-(+++) !tv(+++) b+(++++) G+ e>++++ h+>++ r* y+>*$
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:03    [W:0.417 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site