All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Dave Young <dyoung@redhat.com>
Cc: "Borislav Petkov" <bp@alien8.de>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>, "Franck Bui" <fbui@suse.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Ingo Molnar" <mingo@kernel.org>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: Re: [PATCH -v4 2/2] printk: Add kernel parameter to control writes to /dev/kmsg
Date: Mon, 25 Jul 2016 11:18:10 -0400	[thread overview]
Message-ID: <20160725111810.6230229d@gandalf.local.home> (raw)
In-Reply-To: <20160718081712.GA9239@dhcp-128-65.nay.redhat.com>

On Mon, 18 Jul 2016 16:17:12 +0800
Dave Young <dyoung@redhat.com> 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

      parent reply	other threads:[~2016-07-25 15:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08  9:18 [PATCH -v4 0/2] printk.devkmsg: Ratelimit it by default Borislav Petkov
2016-07-08  9:18 ` [PATCH -v4 1/2] ratelimit: Extend to print suppressed messages on release Borislav Petkov
2016-07-14 20:29   ` Andrew Morton
2016-07-15  4:00     ` Borislav Petkov
2016-07-08  9:18 ` [PATCH -v4 2/2] printk: Add kernel parameter to control writes to /dev/kmsg Borislav Petkov
2016-07-14 20:23   ` Andrew Morton
2016-07-14 20:39     ` Steven Rostedt
2016-07-15  4:29     ` Borislav Petkov
2016-07-15  6:21   ` Dave Young
2016-07-15 12:45     ` Borislav Petkov
2016-07-16 10:44       ` Dave Young
2016-07-17  5:40         ` Borislav Petkov
2016-07-18  2:18           ` Dave Young
2016-07-18  4:44             ` Borislav Petkov
2016-07-18  5:20               ` Dave Young
2016-07-18  7:21                 ` Borislav Petkov
2016-07-18  7:38                   ` Dave Young
2016-07-18  8:08                     ` Borislav Petkov
2016-07-18  8:17                       ` Dave Young
2016-07-18  9:06                         ` Borislav Petkov
2016-07-19  0:35                           ` Dave Young
2016-07-19  6:49                             ` Borislav Petkov
2016-07-19  7:02                               ` Dave Young
2016-07-25 15:18                         ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160725111810.6230229d@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dyoung@redhat.com \
    --cc=fbui@suse.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.