linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Roman Gushchin <guro@fb.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: Yafang Shao <laoar.shao@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Shakeel Butt <shakeelb@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Greg Thelen <gthelen@google.com>, Linux MM <linux-mm@kvack.org>
Subject: Re: [PATCH v2 2/2] mm, memcg: don't try to kill a process if memcg is not populated
Date: Mon, 4 May 2020 10:04:47 -0700	[thread overview]
Message-ID: <20200504170447.GA4687@carbon.lan> (raw)
In-Reply-To: <20200504161113.GV22838@dhcp22.suse.cz>

On Mon, May 04, 2020 at 06:11:13PM +0200, Michal Hocko wrote:
> On Mon 04-05-20 23:24:35, Yafang Shao wrote:
> > On Mon, May 4, 2020 at 8:46 PM Michal Hocko <mhocko@kernel.org> wrote:
> [...]
> > > But the oom situation and the oom report is simply something an admin
> > > has to expect especially when the hard limit is set to 0. With kmem
> > > accounting there is no guarantee that the target will be met.
> > 
> > I'm always wondering that why not moving the kmem from this memcg to
> > the root_mem_cgroup in this situation ?
> > Then this memcg can be easily reclaimed.

It's not that trivial: there are many objects which are keeping a reference
to a memory cgroup. We don't even have a comprehensive list of them.
And we should somehow reassign them to a different cgroup without too much
overhead.
Also it's better to move it to the parent instead of root.

> 
> Roman was playing with kmem charges reparenting.

Slabs are already reparenting. Other objects, which are allocated directly
by the page allocator (e.g. vmallocs) are not. But it will be relatively
easy to cover them after landing my slab controller rework patchset:
https://lore.kernel.org/lkml/20200422204708.2176080-1-guro@fb.com/ .
Basically it provides a framework for charging kernel objects in a way
that provides inexpensive reparenting.

Thanks!


      reply	other threads:[~2020-05-04 17:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04  4:26 [PATCH v2 0/2]memcg oom: don't try to kill a process if there is no process Yafang Shao
2020-05-04  4:26 ` [PATCH v2 1/2] mm, memcg: rename mem_cgroup_out_of_memory() Yafang Shao
2020-05-04  7:59   ` Michal Hocko
2020-05-04 15:50   ` Chris Down
2020-05-04  4:26 ` [PATCH v2 2/2] mm, memcg: don't try to kill a process if memcg is not populated Yafang Shao
2020-05-04  8:18   ` Michal Hocko
2020-05-04 12:34     ` Yafang Shao
2020-05-04 12:46       ` Michal Hocko
2020-05-04 15:24         ` Yafang Shao
2020-05-04 16:11           ` Michal Hocko
2020-05-04 17:04             ` Roman Gushchin [this message]

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=20200504170447.GA4687@carbon.lan \
    --to=guro@fb.com \
    --cc=akpm@linux-foundation.org \
    --cc=gthelen@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=laoar.shao@gmail.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --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