[lkml]   [2001]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Linux 2.4.10: printk() deadlocks wrote:
> Hi, andrew,
> currently I'm porting our WORM filesystem (OWFS) from kernel
> 2.4.0 to kernel 2.4.10. I'm used to rely on printk() to be callable
> from every place in the kernel, but now I experience deadlocks
> when calling it from some places within our filesystem.
> (I'm writing a ~600 lines in 2 seconds and I enlarged the buffer size
> to 1MB, what worked perfectly in the past.)
> The call-chain is:
> ...

But it isn't deadlocked. The EIP points at this statement

spin_unlock_irqrestore(&logbuf_lock, flags);
--> console_may_schedule = 0;

in printk(). So the output is about to come out to
the console device(s).

> A diff between printk.c of the two kernels shows:
> * Rewrote bits to get rid of console_lock
> * 01Mar01 Andrew Morton <>
> Please could you tell me a workaround or some possibility to get out
> of this situation? I think printk() should be an absolutely reliable
> function which never schedules.

printk() doesn't schedule. However, userspace processes which
write to /dev/ttyX *do* schedule, and the two paths use the same
code and have to lock against each other, etc. That's why it's all
rather unclear.

Sorry, but I think you must be doing something strange to make this
happen - can you please diagnose a little further? Investigate
further with kdb? Can you send me the wherewithals to reproduce
it? Are you running SMP?

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:10    [W:0.047 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site