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: Johannes Weiner <hannes@cmpxchg.org>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux MM <linux-mm@kvack.org>
Subject: Re: [PATCH] mm, memcg: show memcg min setting in oom messages
Date: Mon, 25 Nov 2019 09:20:40 +0100	[thread overview]
Message-ID: <20191125082040.GB31714@dhcp22.suse.cz> (raw)
In-Reply-To: <CALOAHbAv7eyXNyBqZd+J-sR=O+hMXFtwfLhvdkh1E17z4p6Fmg@mail.gmail.com>

On Sat 23-11-19 13:52:57, Yafang Shao wrote:
> On Fri, Nov 22, 2019 at 6:28 PM Michal Hocko <mhocko@kernel.org> wrote:
> >
> > On Wed 20-11-19 20:23:54, Yafang Shao wrote:
> > > On Wed, Nov 20, 2019 at 7:40 PM Michal Hocko <mhocko@kernel.org> wrote:
> > > >
> > > > On Wed 20-11-19 18:53:44, Yafang Shao wrote:
> > > > > On Wed, Nov 20, 2019 at 6:22 PM Michal Hocko <mhocko@kernel.org> wrote:
> > > > > >
> > > > > > On Wed 20-11-19 03:53:05, Yafang Shao wrote:
> > > > > > > A task running in a memcg may OOM because of the memory.min settings of his
> > > > > > > slibing and parent. If this happens, the current oom messages can't show
> > > > > > > why file page cache can't be reclaimed.
> > > > > >
> > > > > > min limit is not the only way to protect memory from being reclaim. The
> > > > > > memory might be pinned or unreclaimable for other reasons (e.g. swap
> > > > > > quota exceeded for memcg).
> > > > >
> > > > > Both swap or unreclaimabed (unevicteable) is printed in OOM messages.
> > > >
> > > > Not really. Consider a memcg which has reached it's swap limit. The
> > > > anonymous memory is not really reclaimable even when there is a lot of
> > > > swap space available.
> > > >
> > >
> > > The memcg swap limit is already printed in oom messages, see bellow,
> > >
> > > [  141.721625] memory: usage 1228800kB, limit 1228800kB, failcnt 18337
> > > [  141.721958] swap: usage 0kB, limit 9007199254740988kB, failcnt 0
> >
> > But you do not have any insight on the swap limit down the oom
> > hierarchy, do you?
> >
> > > > > Why not just print the memcgs which are under memory.min protection or
> > > > > something like a total number of min protected memory ?
> > > >
> > > > Yes, this would likely help. But the main question really reamains, is
> > > > this really worth it?
> > > >
> > >
> > > If it doesn't cost too much, I think it is worth to do it.
> > > As the oom path is not the critical path, so adding some print info
> > > should not add much overhead.
> >
> > Generating a lot of output for the oom reports has been a real problem
> > in many deployments.
> 
> So why not only print non-zero counters ?
> If some counters are 0, we don't print them, that can reduce the oom reports.
> 
> Something like "isolated_file:0 unevictable:0 dirty:0 writeback:0
> unstable:0" can all be removed,
> and we consider them as zero by default.

because that would make parsing more complex.

> I mean we can optimze the OOM reports and only print the useful
> information to make it not be a problem in many deployments.

We can, but it would be great to have it backed by som real usecase to
change the current behavior. I haven't heard anything so far. It is all
about "this would be nice" without a strong justification.
-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2019-11-25  8:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20  8:53 Yafang Shao
2019-11-20 10:21 ` Michal Hocko
2019-11-20 10:53   ` Yafang Shao
2019-11-20 11:40     ` Michal Hocko
2019-11-20 12:23       ` Yafang Shao
2019-11-22 10:28         ` Michal Hocko
2019-11-23  5:52           ` Yafang Shao
2019-11-25  8:20             ` Michal Hocko [this message]
2019-11-25  9:12               ` Yafang Shao
2019-11-25  9:27                 ` 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=20191125082040.GB31714@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=vdavydov.dev@gmail.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