From: Michal Hocko <mhocko@suse.com>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
Johannes Weiner <hannes@cmpxchg.org>,
Vladimir Davydov <vdavydov.dev@gmail.com>,
Roman Gushchin <guro@fb.com>
Subject: Re: [PATCH] mm, memcg: introduce per memcg oom_score_adj
Date: Thu, 22 Aug 2019 11:19:02 +0200 [thread overview]
Message-ID: <20190822091902.GG12785@dhcp22.suse.cz> (raw)
In-Reply-To: <1566464189-1631-1-git-send-email-laoar.shao@gmail.com>
On Thu 22-08-19 04:56:29, Yafang Shao wrote:
> - Why we need a per memcg oom_score_adj setting ?
> This is easy to deploy and very convenient for container.
> When we use container, we always treat memcg as a whole, if we have a per
> memcg oom_score_adj setting we don't need to set it process by process.
Why cannot an initial process in the cgroup set the oom_score_adj and
other processes just inherit it from there? This sounds trivial to do
with a startup script.
> It will make the user exhausted to set it to all processes in a memcg.
Then let's have scripts to set it as they are less prone to exhaustion
;)
But seriously
> In this patch, a file named memory.oom.score_adj is introduced.
> The valid value of it is from -1000 to +1000, which is same with
> process-level oom_score_adj.
> When OOM is invoked, the effective oom_score_adj is as bellow,
> effective oom_score_adj = original oom_score_adj + memory.oom.score_adj
This doesn't make any sense to me. Say that process has oom_score_adj
-1000 (never kill) then group oom_score_adj will simply break the
expectation and the task becomes killable for any value but -1000.
Why is summing up those values even sensible?
> The valid effective value is also from -1000 to +1000.
> This is something like a hook to re-calculate the oom_score_adj.
Besides that. What is the hierarchical semantic? Say you have hierarchy
A (oom_score_adj = 1000)
\
B (oom_score_adj = 500)
\
C (oom_score_adj = -1000)
put the above summing up aside for now and just focus on the memcg
adjusting?
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2019-08-22 9:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-22 8:56 Yafang Shao
2019-08-22 9:19 ` Michal Hocko [this message]
2019-08-22 9:34 ` Yafang Shao
2019-08-22 10:59 ` Michal Hocko
2019-08-22 22:46 ` Roman Gushchin
2019-08-23 1:26 ` 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=20190822091902.GG12785@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=guro@fb.com \
--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