From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752125AbcGSAfX (ORCPT ); Mon, 18 Jul 2016 20:35:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49589 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751930AbcGSAfU (ORCPT ); Mon, 18 Jul 2016 20:35:20 -0400 Date: Tue, 19 Jul 2016 08:35:07 +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: <20160719003507.GB3326@dhcp-128-65.nay.redhat.com> References: <20160716104425.GB3031@dhcp-128-65.nay.redhat.com> <20160717054035.GA16383@nazgul.tnic> <20160718021809.GA6310@dhcp-128-65.nay.redhat.com> <20160718044407.GA20395@nazgul.tnic> <20160718052032.GA7911@dhcp-128-65.nay.redhat.com> <20160718072107.GA22689@nazgul.tnic> <20160718073845.GA9088@dhcp-128-65.nay.redhat.com> <20160718080846.GC22689@nazgul.tnic> <20160718081712.GA9239@dhcp-128-65.nay.redhat.com> <20160718090632.GD22689@nazgul.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160718090632.GD22689@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.27]); Tue, 19 Jul 2016 00:35:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/18/16 at 11:06am, Borislav Petkov wrote: > On Mon, Jul 18, 2016 at 04:17:12PM +0800, Dave Young wrote: > > Because IMHO it is wrong, they can not be ratelimited because the writing could > > be from different userspace programs. > > It is ratelimited by interface openers. You are thinking from kernel point of view, but it will be different from a user point of view. > > > Simply ratelimiting different sources of writing is pointless to me. > > So what are you arguing for? What is the *actual* *real-life* *use* case > you think will be handicapped? > > > One can only see messages they would like to see by luck, it is worse > > than off. > > THAT'S WHY YOU BOOT WITH "printk.devkmsg=on" TO SEE THEM ALL! > > The /dev/kmsg thing was added for the more or less, wrong, historic > reasons and userspace started abusing it and interfering with kernel > operation. That's why we're adding this tristate option. > > In the default case we're ratelimiting writes to it because they should > not interfere with kernel operation. > > [ Frankly, those writes are pretty much useless to the normal user so > we can just as well ignore them but WTH. ] > > So give me a concrete problem you see with the ralimiting and not some > notion of a feeling you might have of it being pointless, ok? Ok, for example below (A and B can be any program, systemd or other logging utility, dracut scripts...) Program A: for (i = 0; i < 100; i++) write an error message A1 for (i =0; i < 100; i++) write an error message A2 Program B: for (i = 0; i < 100; i++) write an error message B1 for (i =0; i < 100; i++) write an error message B2 In above case, ratelimit specific message like A1 is reasonable, but simply ratelimit the writing to /dev/kmsg will cause the final messages appear are uncertain. This is not ratelimit should do. We provide a default printk.devkmsg, it should either works or not, the middle point is just wrong because it helps nothing, so what is the benefit of the ratelimit compares with "off"? If there's no benefits why we will make the code complicate? Thanks Dave