linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Andrew Morton <akpm@linux-foundation.org>,
	Roman Gushchin <guro@fb.com>, linux-mm <linux-mm@kvack.org>,
	David Rientjes <rientjes@google.com>,
	Shakeel Butt <shakeelb@google.com>
Subject: Re: [nacked] mm-oom-avoid-printk-iteration-under-rcu.patch removed from -mm tree
Date: Thu, 23 Apr 2020 13:07:07 +0200	[thread overview]
Message-ID: <20200423110707.GD4206@dhcp22.suse.cz> (raw)
In-Reply-To: <CALOAHbAD-JBcoVM+VisN9NBTgzbBaRCg9APDd_pm71Jd19-78w@mail.gmail.com>

On Thu 23-04-20 18:22:22, Yafang Shao wrote:
> On Thu, Apr 23, 2020 at 3:34 PM Michal Hocko <mhocko@suse.com> wrote:
[...]
> > > I think the aysnc printk() won't care about wheter the data is
> > > improtant or not, so the user of printk() (even if it is asyn) should
> > > have a good management of these data especially if these data may
> > > consume all or most of the printk buffer.
> >
> > Not sure what you mean here. We do have an option to tune the ring
> > buffer (both size and log levels) and dump_tasks specifically.
> >
> 
> There're drawbacks in both of these two options.

They surely are and they were meant as a workaround until printk is more
capable to handle the data flow which we need.

> printk() is multiple-producer and mutiple-consumer.
> OOM is one of the producers.
> logfile (/var/log/messages) and console are two of the consumers.
> Now let's see the drawback of each option.
> 
> - tune the ring buffer (both size and log levels)
> All the producers are effected.
> For example, if you tune the log levels, then all producers have the
> same loglevel with dump_stack() can't show in the console.

The existing loglevels we use are not really carved in stone and we can
prioritize some more than others. dump_tasks is KERN_INFO already and
this is quite a low priority so you shouldn't really miss much when
omitting it. But I wouldn't mind making it KERN_DEBUG.

> Tuning the size may be not scalable, because we don't know how slow
> the console is and tuning it too big is a waste of memory.
> 
> - tune the dump_tasks specifically (vm.oom_dump_tasks)
> All the consumers are effected.
> The logfile is fast enough, so we expect that these dump_tasks could
> be printed into the logfile.
> The console is so slow that we don't want to print into it.
> A possilbe way to fix it is improve vm.oom_dump_tasks.
>     vm.oom_dump_tasks : 1 - dump into all consumers
>                                          2 - don't dump into console
>                                          0 - don't dump into any of

How would that be implemented. I do not know of a way to tell printk
which consoles to use for the output.  Anyway, isn't this something
that can be configured on the printk level. In other words send only
important information to slow consoles?

> the consumers
> But someone may still needs these dump_tasks from the console.

Well, most people simply do not care. I know a bold statement but it's
been couple of years since I am staring at oom reports on regular bases
and I have used that information only in a very marginal percentage of them.
Sure different people need different stuff but nothing really prevents
people from enabling the feature if they feel like. With an obvious
caveat that it can generate a lot of output and that is not a great fit
for slow consoles.
-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2020-04-23 11:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200131043324.wkArXTf6-%akpm@linux-foundation.org>
2020-04-17 14:33 ` [nacked] mm-oom-avoid-printk-iteration-under-rcu.patch removed from -mm tree Tetsuo Handa
2020-04-17 15:26   ` Michal Hocko
2020-04-18 10:13     ` Tetsuo Handa
2020-04-20  7:33       ` Michal Hocko
2020-04-22  6:40         ` Tetsuo Handa
2020-04-22  6:59           ` Michal Hocko
2020-04-23  5:34             ` Tetsuo Handa
2020-04-23  6:35               ` Yafang Shao
2020-04-23  7:34                 ` Michal Hocko
2020-04-23 10:22                   ` Yafang Shao
2020-04-23 11:07                     ` Michal Hocko [this message]
2020-04-23 13:28                       ` Tetsuo Handa
2020-04-23 14:06                         ` Michal Hocko
2020-04-23 14:14                           ` Tetsuo Handa
2020-04-23 14:35                             ` Michal Hocko
2020-04-24 13:02                           ` Steven Rostedt
2020-04-24 15:18                             ` Michal Hocko
2020-04-23 15:54                         ` Sergey Senozhatsky
2020-04-23 22:56                           ` Tetsuo Handa
2020-04-24  0:56                         ` Yafang Shao
2020-04-24  1:16                           ` Tetsuo Handa

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=20200423110707.GD4206@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=guro@fb.com \
    --cc=laoar.shao@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=rientjes@google.com \
    --cc=shakeelb@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).