From: Michal Hocko <mhocko@suse.com>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>,
Yafang Shao <shaoyafang@didiglobal.com>,
Roman Gushchin <guro@fb.com>,
Souptick Joarder <jrdr.linux@gmail.com>,
Vladimir Davydov <vdavydov.dev@gmail.com>,
Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
Randy Dunlap <rdunlap@infradead.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: Re: [PATCH v2] mm, memcg: skip killing processes under memcg protection at first scan
Date: Tue, 20 Aug 2019 10:34:12 +0200 [thread overview]
Message-ID: <20190820083412.GK3111@dhcp22.suse.cz> (raw)
In-Reply-To: <CALOAHbC+ByFV6tPOnkmCM9FjxP3wWnQNCWUDO6e6RaeS=Mx8_Q@mail.gmail.com>
On Tue 20-08-19 15:49:20, Yafang Shao wrote:
> On Tue, Aug 20, 2019 at 3:27 PM Michal Hocko <mhocko@suse.com> wrote:
> >
> > On Tue 20-08-19 15:15:54, Yafang Shao wrote:
> > > On Tue, Aug 20, 2019 at 2:40 PM Michal Hocko <mhocko@suse.com> wrote:
> > > >
> > > > On Tue 20-08-19 09:16:01, Yafang Shao wrote:
> > > > > On Tue, Aug 20, 2019 at 5:12 AM Roman Gushchin <guro@fb.com> wrote:
> > > > > >
> > > > > > On Sun, Aug 18, 2019 at 09:18:06PM -0400, Yafang Shao wrote:
> > > > > > > In the current memory.min design, the system is going to do OOM instead
> > > > > > > of reclaiming the reclaimable pages protected by memory.min if the
> > > > > > > system is lack of free memory. While under this condition, the OOM
> > > > > > > killer may kill the processes in the memcg protected by memory.min.
> > > > > > > This behavior is very weird.
> > > > > > > In order to make it more reasonable, I make some changes in the OOM
> > > > > > > killer. In this patch, the OOM killer will do two-round scan. It will
> > > > > > > skip the processes under memcg protection at the first scan, and if it
> > > > > > > can't kill any processes it will rescan all the processes.
> > > > > > >
> > > > > > > Regarding the overhead this change may takes, I don't think it will be a
> > > > > > > problem because this only happens under system memory pressure and
> > > > > > > the OOM killer can't find any proper victims which are not under memcg
> > > > > > > protection.
> > > > > >
> > > > > > Hi Yafang!
> > > > > >
> > > > > > The idea makes sense at the first glance, but actually I'm worried
> > > > > > about mixing per-memcg and per-process characteristics.
> > > > > > Actually, it raises many questions:
> > > > > > 1) if we do respect memory.min, why not memory.low too?
> > > > >
> > > > > memroy.low is different with memory.min, as the OOM killer will not be
> > > > > invoked when it is reached.
> > > >
> > > > Responded in other email thread (please do not post two versions of the
> > > > patch on the same day because it makes conversation too scattered and
> > > > confusing).
> > > >
> > > (This is an issue about time zone :-) )
> >
> > Normally we wait few days until feedback on the particular patch is
> > settled before a new version is posted.
> >
> > > > Think of min limit protection as some sort of a more inteligent mlock.
> > >
> > > Per my perspective, it is a less inteligent mlock, because what it
> > > protected may be a garbage memory.
> > > As I said before, what it protected is the memroy usage, rather than a
> > > specified file memory or anon memory or somethin else.
> > >
> > > The advantage of it is easy to use.
> > >
> > > > It protects from the regular memory reclaim and it can lead to the OOM
> > > > situation (be it global or memcg) but by no means it doesn't prevent
> > > > from the system to kill the workload if there is a need. Those two
> > > > decisions are simply orthogonal IMHO. The later is a an emergency action
> > > > while the former is to help guanratee a runtime behavior of the workload.
> > > >
> > >
> > > If it can handle OOM memory reclaim, it will be more inteligent.
> >
> > Can we get back to an actual usecase please?
> >
>
> No real usecase.
> What we concerned is if it can lead to more OOMs but can't protect
> itself in OOM then this behavior seems a little wierd.
This is a natural side effect of protecting memory from the reclaim.
Read mlock kind of protection. Weird? I dunno. Unexpected, no!
> Setting oom_score_adj is another choice, but there's no memcg-level
> oom_score_adj.
> memory.min is memcg-level, while oom_score_adj is process-level, that
> is wierd as well.
OOM, is per process operation. Sure we have that group kill option but
then still the selection is per-process.
Without any clear usecase in sight I do not think it makes sense to
pursue this further.
Thanks!
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2019-08-20 8:34 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-19 1:18 Yafang Shao
2019-08-19 21:12 ` Roman Gushchin
2019-08-20 1:16 ` Yafang Shao
2019-08-20 1:39 ` Roman Gushchin
2019-08-20 2:01 ` Yafang Shao
2019-08-20 2:40 ` Yafang Shao
2019-08-20 6:40 ` Michal Hocko
2019-08-20 7:15 ` Yafang Shao
2019-08-20 7:27 ` Michal Hocko
2019-08-20 7:49 ` Yafang Shao
2019-08-20 8:34 ` Michal Hocko [this message]
2019-08-20 8:55 ` Yafang Shao
2019-08-20 9:17 ` Michal Hocko
2019-08-20 9:26 ` Yafang Shao
2019-08-20 10:40 ` Michal Hocko
2019-08-20 21:39 ` Roman Gushchin
2019-08-21 1:00 ` Yafang Shao
2019-08-21 6:44 ` Michal Hocko
2019-08-21 7:26 ` Yafang Shao
2019-08-21 8:05 ` Michal Hocko
2019-08-21 8:15 ` Yafang Shao
2019-08-21 8:34 ` Michal Hocko
2019-08-21 8:46 ` 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=20190820083412.GK3111@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=jrdr.linux@gmail.com \
--cc=laoar.shao@gmail.com \
--cc=linux-mm@kvack.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=rdunlap@infradead.org \
--cc=shaoyafang@didiglobal.com \
--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