linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: David Rientjes <rientjes@google.com>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Linux MM <linux-mm@kvack.org>
Subject: Re: [PATCH v2] memcg, oom: check memcg margin for parallel oom
Date: Thu, 16 Jul 2020 14:21:50 +0200	[thread overview]
Message-ID: <20200716122150.GL31089@dhcp22.suse.cz> (raw)
In-Reply-To: <CALOAHbBKLCoaPMneDnk+SiRG5zKyDNoBXSJCXE3=efp4Bkpreg@mail.gmail.com>

On Thu 16-07-20 19:53:12, Yafang Shao wrote:
[...]
> I'd prefer to put dump_header() behind do_send_sig_info(), for example,
> 
> __oom_kill_process()
>     do_send_sig_info()
>     dump_header() <<<< may better put it behind wake_oom_reaper(), but
> it may loses some information to dump...
>     pr_err("%s: Killed process %d (%s)....")
> 
> Because the main goal of OOM is to kill a process to free pages ASAP
> to avoid system stall or memcg stall.
> We all find that  dump_header() may take a long time to finish
> especially if there is a slow console, and this long time may cause a
> great system stall, so we'd better defer the dump of it.

I would be worried that such a memory dump would be very likely not
reflecting the actual OOM situation and thus hard to use for analysis.
Why? Because the killed oom victim can _usually_ die or the oom reaper
can free up a lot of memory very quickly.

If we look at it the main part of the report which takes long to dump is
dump_tasks because this is potentially a lot of data. I haven't seen
show_mem or its memcg counterpart to take a long time. We've discussed
how much dump_tasks is really useful for production systems and the
general feedback was that it should be enabled by default, though.

If the oom report should be misleading then it would be better to not
bother at all IMHO. From my experience the memory state is really useful
when debugging ooms and having a reasonable snapshot is really
important. IIRC Tetsuo was suggesting collecting all the information at
the time of the oom and print that snapshot later on but the patch was
quite invasive and didn't handle multiple OOMs from different oom
domains - especially the dump_task part would need to link all the tasks
for different oom contexts.

Anyway, I think we are getting off topic here.
-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2020-07-16 12:22 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-14 13:57 [PATCH v2] memcg, oom: check memcg margin for parallel oom Yafang Shao
2020-07-14 14:05 ` Michal Hocko
2020-07-14 14:30 ` Chris Down
2020-07-14 18:46 ` David Rientjes
2020-07-15  1:44   ` Yafang Shao
2020-07-15  2:44     ` David Rientjes
2020-07-15  3:10       ` Yafang Shao
2020-07-15  3:18         ` David Rientjes
2020-07-15  3:31           ` Yafang Shao
2020-07-15 17:30             ` David Rientjes
2020-07-16  2:38               ` Yafang Shao
2020-07-16  7:04                 ` David Rientjes
2020-07-16 11:53                   ` Yafang Shao
2020-07-16 12:21                     ` Michal Hocko [this message]
2020-07-16 13:09                       ` Tetsuo Handa
2020-07-16 19:53                     ` David Rientjes
2020-07-17  1:35                       ` Yafang Shao
2020-07-17 19:26                         ` David Rientjes
2020-07-18  2:15                           ` Yafang Shao
2020-07-16  5:54               ` Tetsuo Handa
2020-07-16  6:11                 ` Michal Hocko
2020-07-16  7:06                   ` David Rientjes
2020-07-16  6:08               ` Michal Hocko
2020-07-16  6:56                 ` David Rientjes
2020-07-16  7:12                   ` Michal Hocko
2020-07-16 20:04                     ` David Rientjes
2020-07-28 18:04                   ` Johannes Weiner
2020-07-15  6:56         ` Michal Hocko

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=20200716122150.GL31089@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=laoar.shao@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=rientjes@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).