Re: printk() vs tty_io

From: Linus Torvalds
Date: Thu Dec 15 2011 - 12:08:55 EST


On Thu, Dec 15, 2011 at 1:56 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> We probably could, I can have a closer look, but the main question is,
> are we going to commit to no wakeups from console implementations? That
> would mean removing the USB serial console support and other such stuff.

I guess we can't.

So new approach:

- screw it. the rq lock is just too central, you cannot call printk
from under it. And if you have an oops under it, you're screwed.

Peter, why do you want to try to work from under the rq lock?

- Make a special "debug printk" that is not synchronous. Just make it
buffer things, and have it actually print out from a worker thread or
whatever. This one *only* takes the lock for that buffer itself, and
works everywhere. We could probably even do tricks to make it
NMI-safe.

Make code that isn't an oops or other very synchronous "have to
print out *now*" aim to use this "softer" printk.

Hmm?

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