linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: "Ricardo Cañuelo" <ricardo.canuelo@collabora.com>,
	"Michal Hocko" <mhocko@suse.com>,
	akpm@linux-foundation.org, kernel@collabora.com, hch@lst.de,
	guro@fb.com, rientjes@google.com, mcgrof@kernel.org,
	keescook@chromium.org, yzaikin@google.com, linux-mm@kvack.org,
	"Sergey Senozhatsky" <sergey.senozhatsky@gmail.com>,
	"Steven Rostedt" <rostedt@goodmis.org>
Subject: Re: [PATCH] mm, oom: enable rate-limiting controls for oom dumps
Date: Thu, 15 Oct 2020 15:05:54 +0200	[thread overview]
Message-ID: <20201015130554.GF8871@alley> (raw)
In-Reply-To: <9cb10e17-ac04-9f7d-2138-cc044e2b080b@i-love.sakura.ne.jp>

On Tue 2020-10-13 19:46:32, Tetsuo Handa wrote:
> On 2020/10/13 18:02, Petr Mladek wrote:
> > On Tue 2020-10-13 09:40:27, Tetsuo Handa wrote:
> >> Proper ratelimiting for OOM messages had better not to count on asynchronous printk().
> > 
> > I am a bit confused. AFAIK, you wanted to print OOM messages
> > asynchronous ways in the past. The lockless printk ringbuffer is on
> > its way into 5.10. Handling consoles in kthreads will be the next
> > step of the printk rework.
> 
> What I'm proposing is synchronously printing OOM messages from a different
> thread, for one dump_tasks() call can generate thousands of lines which may
> significantly delay arrival of non OOM related messages to consoles (or even
> drop due to logbuf being full). I don't want to enqueue too many OOM related
> messages to logbuf, even after printk() became completely asynchronous.

This looks like a lot of complexity. I am not convinced that it is
worth it. I could understand that people heavily testing OOM behavior
meet this problem. But I wonder how many people really meet this
problem in the real life.

> > Could you please provide some examples how you would tune ratelimit
> > when printing all messages to the console takes X ms and OOM
> > happens every Y ms?
> 
> My proposal is to decide whether to print the new report based on
> whether all OOM candidates for that OOM domain have been flushed to
> consoles. There is no X and Y.

From the printk() point of view, we need an API that would provide
information whether a given message reached the consoles or not.
Then it would be up to the MM-code to use it.

One catch might be when console_seq is synchronized by console_lock.
Because the caller of this API would become responsible for flushing
all existing messages. But it should be usable. It is currently
synchronized also by logbuf_lock.

Best Regards,
Petr


  reply	other threads:[~2020-10-15 13:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09  9:30 [PATCH] mm, oom: enable rate-limiting controls for oom dumps Ricardo Cañuelo
2020-10-12 15:18 ` Michal Hocko
2020-10-13  9:23   ` Ricardo Cañuelo
2020-10-13 11:56     ` Michal Hocko
2020-10-12 15:22 ` Petr Mladek
2020-10-12 15:41   ` Michal Hocko
2020-10-13  0:40     ` Tetsuo Handa
2020-10-13  7:25       ` Michal Hocko
2020-10-13  9:02       ` Petr Mladek
2020-10-13 10:46         ` Tetsuo Handa
2020-10-15 13:05           ` Petr Mladek [this message]
2020-10-13  9:18   ` Ricardo Cañuelo

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=20201015130554.GF8871@alley \
    --to=pmladek@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=guro@fb.com \
    --cc=hch@lst.de \
    --cc=keescook@chromium.org \
    --cc=kernel@collabora.com \
    --cc=linux-mm@kvack.org \
    --cc=mcgrof@kernel.org \
    --cc=mhocko@suse.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=ricardo.canuelo@collabora.com \
    --cc=rientjes@google.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=yzaikin@google.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).