[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.01.0910120837030.3438@localhost.localdomain>
Date: Mon, 12 Oct 2009 08:44:30 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Simon Kagstrom <simon.kagstrom@...insight.net>
cc: Ingo Molnar <mingo@...e.hu>,
Artem Bityutskiy <dedekind1@...il.com>,
David Woodhouse <dwmw2@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
"Koskinen Aaro (Nokia-D/Helsinki)" <aaro.koskinen@...ia.com>,
linux-mtd <linux-mtd@...ts.infradead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: Re: [PATCH] panic.c: export panic_on_oops
On Mon, 12 Oct 2009, Linus Torvalds wrote:
>
> Don't. kfifo's aren't going to help. You're doing this at all the wrong
> levels ENTIRELY, and we already have the buffer you want to flush.
Btw, a few simple rules:
- if you need to make your device look like a "console device" for
dumping at oops time, you're doing things wrong. You don't want line
buffered output to begin with, and you don't want to see each line, you
only want this at exceptional points.
- if you need to look at "in_interrupt()" or "panic_on_oops", you're
doing things wrong.
- if you add your own buffers, you're doing things wrong. I have
CONFIG_LOG_BUF_SHIFT=18 in my kernel, so I've already got 256kB worth
of memory allocated for kernel messages. Sometimes I increase that
further, just because I do some silly printk debugging.
IOW, just add a very simple "flush the dmesg buffer on oops" callback to
the end of the oops printout code (just a single call after the oops thing
is now known to be in the dmesg buffers!)
It's not just oopses, btw. Maybe people would like to do this as the last
stage of a reboot/shutdown too. Because some of the final printouts from
the shutdown will never make it to disk, because 'ksyslogd' has been
killed, and the root filesystem has been turned read-only.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists