All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: David Rientjes <rientjes@google.com>,
	Roman Gushchin <guro@fb.com>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Tejun Heo <tj@kernel.org>,
	kernel-team@fb.com, cgroups@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [patch -mm v2 2/3] mm, memcg: replace cgroup aware oom killer mount option with tunable
Date: Mon, 29 Jan 2018 11:46:57 +0100	[thread overview]
Message-ID: <20180129104657.GC21609@dhcp22.suse.cz> (raw)
In-Reply-To: <20180126161735.b999356fbe96c0acd33aaa66@linux-foundation.org>

On Fri 26-01-18 16:17:35, Andrew Morton wrote:
> On Fri, 26 Jan 2018 14:52:59 -0800 (PST) David Rientjes <rientjes@google.com> 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 <mhocko@suse.com>
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 <mhocko@suse.com>
---
 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
+future.
 
 If there are no cgroups with the enabled memory controller,
 the OOM killer is using the "traditional" process-based approach.
-- 
2.15.1
-- 
Michal Hocko
SUSE Labs

WARNING: multiple messages have this Message-ID (diff)
From: Michal Hocko <mhocko@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: David Rientjes <rientjes@google.com>,
	Roman Gushchin <guro@fb.com>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Tejun Heo <tj@kernel.org>,
	kernel-team@fb.com, cgroups@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [patch -mm v2 2/3] mm, memcg: replace cgroup aware oom killer mount option with tunable
Date: Mon, 29 Jan 2018 11:46:57 +0100	[thread overview]
Message-ID: <20180129104657.GC21609@dhcp22.suse.cz> (raw)
In-Reply-To: <20180126161735.b999356fbe96c0acd33aaa66@linux-foundation.org>

On Fri 26-01-18 16:17:35, Andrew Morton wrote:
> On Fri, 26 Jan 2018 14:52:59 -0800 (PST) David Rientjes <rientjes@google.com> 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?

WARNING: multiple messages have this Message-ID (diff)
From: Michal Hocko <mhocko@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: David Rientjes <rientjes@google.com>,
	Roman Gushchin <guro@fb.com>,
	Vladimir Davydov <vdavydov.dev@gmail.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Tejun Heo <tj@kernel.org>,
	kernel-team@fb.com, cgroups@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [patch -mm v2 2/3] mm, memcg: replace cgroup aware oom killer mount option with tunable
Date: Mon, 29 Jan 2018 11:46:57 +0100	[thread overview]
Message-ID: <20180129104657.GC21609@dhcp22.suse.cz> (raw)
In-Reply-To: <20180126161735.b999356fbe96c0acd33aaa66@linux-foundation.org>

On Fri 26-01-18 16:17:35, Andrew Morton wrote:
> On Fri, 26 Jan 2018 14:52:59 -0800 (PST) David Rientjes <rientjes@google.com> 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 <mhocko@suse.com>
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 <mhocko@suse.com>
---
 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
+future.
 
 If there are no cgroups with the enabled memory controller,
 the OOM killer is using the "traditional" process-based approach.
-- 
2.15.1
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2018-01-29 10:47 UTC|newest]

Thread overview: 120+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17  2:14 [patch -mm 0/4] mm, memcg: introduce oom policies David Rientjes
2018-01-17  2:14 ` David Rientjes
2018-01-17  2:15 ` [patch -mm 1/4] mm, memcg: introduce per-memcg oom policy tunable David Rientjes
2018-01-17  2:15   ` David Rientjes
2018-01-17  2:15 ` [patch -mm 2/4] mm, memcg: replace cgroup aware oom killer mount option with tunable David Rientjes
2018-01-17  2:15   ` David Rientjes
2018-01-17  2:15 ` [patch -mm 3/4] mm, memcg: replace memory.oom_group with policy tunable David Rientjes
2018-01-17  2:15   ` David Rientjes
2018-01-17  2:15   ` David Rientjes
2018-01-17 15:41   ` Tejun Heo
2018-01-17 15:41     ` Tejun Heo
2018-01-17 16:00     ` Michal Hocko
2018-01-17 16:00       ` Michal Hocko
2018-01-17 22:18       ` David Rientjes
2018-01-17 22:18         ` David Rientjes
2018-01-23 15:13         ` Michal Hocko
2018-01-23 15:13           ` Michal Hocko
2018-01-17 22:14     ` David Rientjes
2018-01-17 22:14       ` David Rientjes
2018-01-19 20:53       ` David Rientjes
2018-01-19 20:53         ` David Rientjes
2018-01-20 12:32         ` Tejun Heo
2018-01-20 12:32           ` Tejun Heo
2018-01-20 12:32           ` Tejun Heo
2018-01-22 22:34           ` David Rientjes
2018-01-22 22:34             ` David Rientjes
2018-01-23 15:53             ` Michal Hocko
2018-01-23 15:53               ` Michal Hocko
2018-01-23 22:22               ` David Rientjes
2018-01-23 22:22                 ` David Rientjes
2018-01-24  8:20                 ` Michal Hocko
2018-01-24  8:20                   ` Michal Hocko
2018-01-24 21:44                   ` David Rientjes
2018-01-24 21:44                     ` David Rientjes
2018-01-24 22:08                     ` Andrew Morton
2018-01-24 22:08                       ` Andrew Morton
2018-01-24 22:08                       ` Andrew Morton
2018-01-24 22:18                       ` Tejun Heo
2018-01-24 22:18                         ` Tejun Heo
2018-01-25  8:11                       ` Michal Hocko
2018-01-25  8:11                         ` Michal Hocko
2018-01-25  8:11                         ` Michal Hocko
2018-01-25  8:05                     ` Michal Hocko
2018-01-25  8:05                       ` Michal Hocko
2018-01-25  8:05                       ` Michal Hocko
2018-01-25 23:27                       ` David Rientjes
2018-01-25 23:27                         ` David Rientjes
2018-01-26 10:07                         ` Michal Hocko
2018-01-26 10:07                           ` Michal Hocko
2018-01-26 22:33                           ` David Rientjes
2018-01-26 22:33                             ` David Rientjes
2018-01-17  2:15 ` [patch -mm 4/4] mm, memcg: add hierarchical usage oom policy David Rientjes
2018-01-17  2:15   ` David Rientjes
2018-01-17 11:46 ` [patch -mm 0/4] mm, memcg: introduce oom policies Roman Gushchin
2018-01-17 11:46   ` Roman Gushchin
2018-01-17 22:31   ` David Rientjes
2018-01-17 22:31     ` David Rientjes
2018-01-25 23:53 ` [patch -mm v2 0/3] " David Rientjes
2018-01-25 23:53   ` David Rientjes
2018-01-25 23:53   ` [patch -mm v2 1/3] mm, memcg: introduce per-memcg oom policy tunable David Rientjes
2018-01-25 23:53     ` David Rientjes
2018-01-26 17:15     ` Michal Hocko
2018-01-26 17:15       ` Michal Hocko
2018-01-26 17:15       ` Michal Hocko
2018-01-29 22:38       ` David Rientjes
2018-01-29 22:38         ` David Rientjes
2018-01-30  8:50         ` Michal Hocko
2018-01-30  8:50           ` Michal Hocko
2018-01-30  8:50           ` Michal Hocko
2018-01-30 22:38           ` David Rientjes
2018-01-30 22:38             ` David Rientjes
2018-01-31  9:47             ` Michal Hocko
2018-01-31  9:47               ` Michal Hocko
2018-02-01 10:11               ` David Rientjes
2018-02-01 10:11                 ` David Rientjes
2018-01-25 23:53   ` [patch -mm v2 2/3] mm, memcg: replace cgroup aware oom killer mount option with tunable David Rientjes
2018-01-25 23:53     ` David Rientjes
2018-01-26  0:00     ` Andrew Morton
2018-01-26  0:00       ` Andrew Morton
2018-01-26 22:20       ` David Rientjes
2018-01-26 22:20         ` David Rientjes
2018-01-26 22:39         ` Andrew Morton
2018-01-26 22:39           ` Andrew Morton
2018-01-26 22:52           ` David Rientjes
2018-01-26 22:52             ` David Rientjes
2018-01-27  0:17             ` Andrew Morton
2018-01-27  0:17               ` Andrew Morton
2018-01-29 10:46               ` Michal Hocko [this message]
2018-01-29 10:46                 ` Michal Hocko
2018-01-29 10:46                 ` Michal Hocko
2018-01-29 19:11                 ` Tejun Heo
2018-01-29 19:11                   ` Tejun Heo
2018-01-29 19:11                   ` Tejun Heo
2018-01-30  8:54                   ` Michal Hocko
2018-01-30  8:54                     ` Michal Hocko
2018-01-30  8:54                     ` Michal Hocko
2018-01-30 11:58                     ` Roman Gushchin
2018-01-30 11:58                       ` Roman Gushchin
2018-01-30 11:58                       ` Roman Gushchin
2018-01-30 12:08                       ` Michal Hocko
2018-01-30 12:08                         ` Michal Hocko
2018-01-30 12:08                         ` Michal Hocko
2018-01-30 12:13                         ` Roman Gushchin
2018-01-30 12:13                           ` Roman Gushchin
2018-01-30 12:13                           ` Roman Gushchin
2018-01-30 12:20                           ` Michal Hocko
2018-01-30 12:20                             ` Michal Hocko
2018-01-30 12:20                             ` Michal Hocko
2018-01-30 15:15                             ` Tejun Heo
2018-01-30 15:15                               ` Tejun Heo
2018-01-30 17:30                             ` Johannes Weiner
2018-01-30 17:30                               ` Johannes Weiner
2018-01-30 17:30                               ` Johannes Weiner
2018-01-30 19:39                             ` Andrew Morton
2018-01-30 19:39                               ` Andrew Morton
2018-01-30 19:39                               ` Andrew Morton
2018-01-29 22:16               ` David Rientjes
2018-01-29 22:16                 ` David Rientjes
2018-01-25 23:53   ` [patch -mm v2 3/3] mm, memcg: add hierarchical usage oom policy David Rientjes
2018-01-25 23:53     ` David Rientjes

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=20180129104657.GC21609@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=guro@fb.com \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@fb.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=rientjes@google.com \
    --cc=tj@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.