Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751703AbYHKMDg (ORCPT ); Mon, 11 Aug 2008 08:03:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751352AbYHKMD2 (ORCPT ); Mon, 11 Aug 2008 08:03:28 -0400 Received: from mx2.mail.elte.hu ([157.181.151.9]:57733 "EHLO mx2.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750855AbYHKMD1 (ORCPT ); Mon, 11 Aug 2008 08:03:27 -0400 Date: Mon, 11 Aug 2008 14:02:31 +0200 From: Ingo Molnar To: Peter Zijlstra Cc: Andi Kleen , Andrew Morton , torvalds@linux-foundation.org, tglx@linutronix.de, marcin.slusarz@gmail.com, linux-kernel@vger.kernel.org, davem@davemloft.net, rostedt@goodmis.org, paulmck@linux.vnet.ibm.com Subject: Re: [PATCH] printk: robustify printk Message-ID: <20080811120231.GC23529@elte.hu> References: <1218217257.29098.2.camel@lappy.programming.kicks-ass.net> <1218219269.29098.5.camel@lappy.programming.kicks-ass.net> <20080808121428.646a8b3c.akpm@linux-foundation.org> <1218223269.29098.12.camel@lappy.programming.kicks-ass.net> <1218224829.29098.19.camel@lappy.programming.kicks-ass.net> <20080811104526.GA15186@elte.hu> <87zlnj24qc.fsf@basil.nowhere.org> <1218453726.10800.63.camel@twins> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1218453726.10800.63.camel@twins> User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.3 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2303 Lines: 54 * Peter Zijlstra wrote: > > The problem is that it means any printk data output that is more > > than DMESG-BUFFER-SIZE bytes during one clock tick is going to lose > > data. It loses the natural adaption to higher printk rates that you > > got previously. > > > > Now we could say that for debugging etc. people should switch to > > other mechanisms like relayfs, but I would still worry about some > > corner cases where losing printk data that wasn't lost before could > > be a severe regression (e.g. consider firewall log messages or > > similar) That's a rather misleading argument, because klogd as it stands today is already lossy: you can overflow it with enough printk data. (It's rather easy to trigger it as well, so nobody sane relies on it as a reliable channel.) Using relayfs and dynamic buffers would be a much worse approach because if we are out of buffer space it would be a robustness disaster to start allocating more RAM. (we want less coupling of printk to other kernel subsystems, not more coupling) Preallocating wont help either because it doesnt protect against sudden spikes. > You only loose the msgs with klogd, console still gets everything. If > firewalls are generating that much data, perhaps its time to think > about alternative ways to channel that. yeah, and note that klogd as it stands today is a lossy channel no matter what - there's nothing that keeps a really verbose kernel from flooding the buffer. The issue Andi raises is largely independent of this change and there's three clean options to deal with it: - increase buffering (already possible, see CONFIG_LOG_BUF_SHIFT) - create a more reliable klogd channel with a dynamically shrinking/growing buffer (i very much doubt the complexity is worth it, and this one wont be 100% loss-less either) - use a reliable console #1 is what distros use to maximize the yield of user bugreports, and #3 is what everyone who ultimately cares about massive printk output and reliable logging uses. Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/