From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751426AbcGRCSU (ORCPT ); Sun, 17 Jul 2016 22:18:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59726 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931AbcGRCSR (ORCPT ); Sun, 17 Jul 2016 22:18:17 -0400 Date: Mon, 18 Jul 2016 10:18:09 +0800 From: Dave Young To: Borislav Petkov Cc: Andrew Morton , LKML , Franck Bui , Greg Kroah-Hartman , Ingo Molnar , Linus Torvalds , Peter Zijlstra , Steven Rostedt , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [PATCH -v4 2/2] printk: Add kernel parameter to control writes to /dev/kmsg Message-ID: <20160718021809.GA6310@dhcp-128-65.nay.redhat.com> References: <1467969530-5215-1-git-send-email-bp@alien8.de> <1467969530-5215-3-git-send-email-bp@alien8.de> <20160715062109.GA4515@dhcp-128-65.nay.redhat.com> <20160715124523.GA26501@nazgul.tnic> <20160716104425.GB3031@dhcp-128-65.nay.redhat.com> <20160717054035.GA16383@nazgul.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160717054035.GA16383@nazgul.tnic> User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 18 Jul 2016 02:18:16 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/17/16 at 07:40am, Borislav Petkov wrote: > On Sat, Jul 16, 2016 at 06:44:25PM +0800, Dave Young wrote: > > ... > > > Mis-ratelimit cause critical userspace messages being lost, that is worse > > The current setting is quite generous so that all critical messages > should land in dmesg. Besides, we don't ratelimit during boot. The idea > is that userspace should switch to a different logging facility once the > system is up... which userspace does reportedly. I would say avoiding ratelimit during boot make no much sense. Userspace can not write to /dev/kmsg when system_state == SYSTEM_BOOTING because init process has not run yet. > > IOW, /dev/kmsg should handle a relatively big logging amount without > ratelimiting. > > > than use off as default. Suppose we turn off devkmsg by default distributions > > can still turn on it with sysctl and for us who do not want the flooding we can > > use printk.devkmsg=off in kernel cmdline to override it. > > That part I cannot parse. I do not understand, care to elaborate a bit? Let me explain my comments, I means to set printk.devkmsg=off by default, userspace can set it to on by sysctl. User can provide kernel cmdline printk.devkmsg=off if he/she want. Or set printk.devkmsg=on by default to avoid break userspace, it is also fine. > > > Of course if we turn off it by default we can print a warning to alert user. > > > > BTW, for userspace messages maybe they should not go to same log buffer, maybe > > a separate log buffer for /dev/msg will be better. > > See above. > Thanks Dave