[lkml]   [2018]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [patch -mm v2 2/3] mm, memcg: replace cgroup aware oom killer mount option with tunable
On Fri 26-01-18 16:17:35, Andrew Morton wrote:
> On Fri, 26 Jan 2018 14:52:59 -0800 (PST) David Rientjes <> wrote:
> > Those use cases are also undocumented such that the user doesn't know the
> > behavior they are opting into. Nowhere in the patchset does it mention
> > anything about oom_score_adj other than being oom disabled. It doesn't
> > mention that a per-process tunable now depends strictly on whether it is
> > attached to root or not. It specifies a fair comparison between the root
> > mem cgroup and leaf mem cgroups, which is obviously incorrect by the
> > implementation itself. So I'm not sure the user would know which use
> > cases it is valid for, which is why I've been trying to make it generally
> > purposeful and documented.
> Documentation patches are nice. We can cc:stable them too, so no huge
> hurry.

What about this?

From c02d8bc1396d5ab3785d01f577e2ee74e5dd985e Mon Sep 17 00:00:00 2001
From: Michal Hocko <>
Date: Mon, 29 Jan 2018 11:42:59 +0100
Subject: [PATCH] oom, memcg: clarify root memcg oom accounting

David Rientjes has pointed out that the current way how the root memcg
is accounted for the cgroup aware OOM killer is undocumented. Unlike
regular cgroups there is no accounting going on in the root memcg
(mostly for performance reasons). Therefore we are suming up oom_badness
of its tasks. This might result in an over accounting because of the
oom_score_adj setting. Document this for now.

Signed-off-by: Michal Hocko <>
Documentation/cgroup-v2.txt | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/cgroup-v2.txt b/Documentation/cgroup-v2.txt
index 2eaed1e2243d..7dff106bba57 100644
--- a/Documentation/cgroup-v2.txt
+++ b/Documentation/cgroup-v2.txt
@@ -1292,7 +1292,11 @@ the memory controller considers only cgroups belonging to the sub-tree
of the OOM'ing cgroup.

The root cgroup is treated as a leaf memory cgroup, so it's compared
-with other leaf memory cgroups and cgroups with oom_group option set.
+with other leaf memory cgroups and cgroups with oom_group option
+set. Due to internal implementation restrictions the size of the root
+cgroup is a cumulative sum of oom_badness of all its tasks (in other
+words oom_score_adj of each task is obeyed). This might change in the

If there are no cgroups with the enabled memory controller,
the OOM killer is using the "traditional" process-based approach.
Michal Hocko
 \ /
  Last update: 2018-01-29 11:48    [W:0.143 / U:4.516 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site