From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753077AbcGYPSX (ORCPT ); Mon, 25 Jul 2016 11:18:23 -0400 Received: from smtprelay0190.hostedemail.com ([216.40.44.190]:49076 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752646AbcGYPSQ (ORCPT ); Mon, 25 Jul 2016 11:18:16 -0400 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,rostedt@goodmis.org,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:981:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2692:2693:2892:2918:3138:3139:3140:3141:3142:3167:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4043:4250:4321:4605:5007:6117:6119:6261:7875:7903:10004:10400:10848:10967:11232:11658:11914:12517:12519:12740:13069:13180:13229:13311:13357:13439:14096:14097:14181:14659:14721:21080:21212:21433:30054:30075:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: arm31_81b44ab57a234 X-Filterd-Recvd-Size: 3400 Date: Mon, 25 Jul 2016 11:18:10 -0400 From: Steven Rostedt To: Dave Young Cc: Borislav Petkov , Andrew Morton , LKML , Franck Bui , Greg Kroah-Hartman , Ingo Molnar , Linus Torvalds , Peter Zijlstra , Uwe =?UTF-8?B?S2xlaW5lLUvDtm5pZw==?= Subject: Re: [PATCH -v4 2/2] printk: Add kernel parameter to control writes to /dev/kmsg Message-ID: <20160725111810.6230229d@gandalf.local.home> In-Reply-To: <20160718081712.GA9239@dhcp-128-65.nay.redhat.com> References: <20160715062109.GA4515@dhcp-128-65.nay.redhat.com> <20160715124523.GA26501@nazgul.tnic> <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> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Jul 2016 16:17:12 +0800 Dave Young wrote: > On 07/18/16 at 10:08am, Borislav Petkov wrote: > > On Mon, Jul 18, 2016 at 03:38:45PM +0800, Dave Young wrote: > > > no printk.devkmsg= on kernel cmdline > > > -> unlocked, default is off, writing to /dev/kmsg is forbidded > > > -> usespace set sysctl printk.devkmsg=on > > > -> writing to /dev/kmsg is allowed. > > > > And that helps how exactly? > > > > I don't understand why you're harping on the ratelimiting. It is a sane > > default for the *default* case. Userspace should switch to its own > > logging scheme when it has started anyway. > > Because IMHO it is wrong, they can not be ratelimited because the writing could > be from different userspace programs. Simply ratelimiting different sources of > writing is pointless to me. One can only see messages they would like to see > by luck, it is worse than off. > [ sorry for coming in late, I've been on vacation ] Note, this is a kernel resource that, IMHO should never had been accessed by userspace in the first place. Perhaps we should create a separate buffer for userspace instead. But until then, we need this usage. If ratelimit is triggered, then something is blasting the limited resource of the kernel, and information will be lost. Most of the time, it's the first lines that are needed to determine what happened, so if something starts writing a lot into the buffer, you want to save what was first written. That's the most critical part. Rate limiting will help save the part you want to see most. And it could have been the kernel that caused the issue. Rate limiting userspace to preserve the kernel output is a good thing. -- Steve