Received: from mx3.mail.elte.hu ([157.181.1.138]) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1MxPYv-0003OG-Ua for linux-mtd@lists.infradead.org; Mon, 12 Oct 2009 18:24:06 +0000 Date: Mon, 12 Oct 2009 20:23:46 +0200 From: Ingo Molnar To: Andrew Morton Subject: Re: [PATCH] panic.c: export panic_on_oops Message-ID: <20091012182346.GH17138@elte.hu> References: <20091012113758.GB11035@elte.hu> <20091012140149.6789efab@marrow.netinsight.se> <20091012120951.GA16799@elte.hu> <1255349748.10605.13.camel@macbook.infradead.org> <20091012122023.GA19365@elte.hu> <20091012150650.51a4b4dc@marrow.netinsight.se> <20091012131528.GC25464@elte.hu> <20091012153937.0dcd73e5@marrow.netinsight.se> <20091012110954.67d7d8d8.akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091012110954.67d7d8d8.akpm@linux-foundation.org> Cc: Artem Bityutskiy , David Woodhouse , LKML , "Koskinen Aaro \(Nokia-D/Helsinki\)" , linux-mtd , Simon Kagstrom , Linus Torvalds , Alan Cox List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , * Andrew Morton wrote: > On Mon, 12 Oct 2009 08:36:38 -0700 (PDT) Linus Torvalds wrote: > > > I agree with the "save kernel buffer on panic" thing, but I disagree with > > making it anything new, and hooking into "printk()" or the console > > subsystem AT ALL. That's just bogus, stupid, and WRONG. > > > > What you can do is to just flush the 'log_buf' buffer (or as much of it as > > you want - the buffer may be a megabyte in size, and maybe you only want > > to flush the last 8kB or something like that) on oops. And _not_ mix this > > up with anything else. > > What he said. I did it that way in the Digeo kernel back in 2002. > Worked good. > > Doing it via a console is rather weird. It will need core kernel > changes to do it properly. > > Perhaps oops_enter() is a good place to mark the start of the log, and > flush it within oops_exit(). Simplest would be to do the last 2K in oops_exit()? That gives the oops, and the history leading up to it. Since the blocking is 2K, the extra log output is for free. (unless the oops is larger than 2K - but that is rather rare.) Ingo