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: avoid oom if cgroup is not populated
Date: Tue, 26 Nov 2019 16:06:23 +0100	[thread overview]
Message-ID: <20191126150623.GI20912@dhcp22.suse.cz> (raw)
In-Reply-To: <CALOAHbBYGWCZZBZ0zOjyivU2SNCfE-ii64JY8FbSAbxgUoc+Ng@mail.gmail.com>

On Tue 26-11-19 22:51:30, Yafang Shao wrote:
> On Tue, Nov 26, 2019 at 10:45 PM Michal Hocko <mhocko@kernel.org> wrote:
> >
> > On Tue 26-11-19 22:25:27, Yafang Shao wrote:
> > > On Tue, Nov 26, 2019 at 9:16 PM Michal Hocko <mhocko@kernel.org> wrote:
> > > >
> > > > On Tue 26-11-19 08:02:49, Yafang Shao wrote:
> > > > > There's one case that the processes in a memcg are all exit (due to OOM
> > > > > group or some other reasons), but the file page caches are still exist.
> > > > > These file page caches may be protected by memory.min so can't be
> > > > > reclaimed. If we can't success to restart the processes in this memcg or
> > > > > don't want to make this memcg offline, then we want to drop the file page
> > > > > caches.
> > > > > The advantage of droping this file caches is it can avoid the reclaimer
> > > > > (either kswapd or direct) scanning and reclaiming pages from all memcgs
> > > > > exist in this system, because currently the reclaimer will fairly reclaim
> > > > > pages from all memcgs if the system is under memory pressure.
> > > > > The possible method to drop these file page caches is setting the
> > > > > hard limit of this memcg to 0. Unfortunately this may invoke the OOM killer
> > > > > and generates lots of misleading outputs, that should not happen.
> > > >
> > > > I disagree that the output is misleading. Quite contrary, it provides a
> > > > useful lead on the unreclaimable memory.
> > > >
> > >
> > > We can show the unreclaimable memory independently, rather than print
> > > the full oom output.
> > > OOM killer is used to kill process, why do we invoke it when there's
> > > no process ?
> > > What's the advantage of doing it ?
> >
> > Consistency.
> >
> 
> If there are tasks, we invoke the OOM killer  to try to kill the tasks.
> If there're no tasks, we just try to free the reclaimable pages.

The fact that the oom killer has been invoked implies there is _no_
reclaimable memory. Full stop.

Anyway I am getting a bit tired to repeat myself so I am not continuing
in this discussion. I have provided my feedback to your patch, please
try to think harder about it. If you have real life usecases which
cannot work properly with the existing functionality and APIs then bring
them up.
-- 
Michal Hocko
SUSE Labs


  reply	other threads:[~2019-11-26 15:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 13:02 Yafang Shao
2019-11-26 13:16 ` Michal Hocko
2019-11-26 14:25   ` Yafang Shao
2019-11-26 14:45     ` Michal Hocko
2019-11-26 14:51       ` Yafang Shao
2019-11-26 15:06         ` Michal Hocko [this message]
2019-11-26 16:30 ` Johannes Weiner
2019-11-27  1:16   ` Yafang Shao

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=20191126150623.GI20912@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