All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal =?unknown-8bit?q?Koutn=C3=BD?= <mkoutny@suse.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] mm: memcg: link page counters to root if use_hierarchy is false
Date: Thu, 29 Oct 2020 16:39:21 +0100	[thread overview]
Message-ID: <20201029153921.GC9928@blackbook> (raw)
In-Reply-To: <20201026231326.3212225-1-guro@fb.com>

Hi.

On Mon, Oct 26, 2020 at 04:13:26PM -0700, Roman Gushchin <guro@fb.com> wrote:
> Please note, that in the non-hierarchical mode all objcgs are always
> reparented to the root memory cgroup, even if the hierarchy has more
> than 1 level. This patch doesn't change it.
> 
> The patch also doesn't affect how the hierarchical mode is working,
> which is the only sane and truly supported mode now.
I agree with the patch and you can add
Reviewed-by: Michal Koutn? <mkoutny@suse.com>

However, it effectively switches any users of root.use_hierarchy=0 (if there
are any, watching the counters of root memcg) into root.use_hierarchy=1.
So I'd show them the warning even with a single level of cgroups, i.e.
add this hunk

@@ -5356,12 +5356,11 @@
 		page_counter_init(&memcg->kmem, &root_mem_cgroup->kmem);
 		page_counter_init(&memcg->tcpmem, &root_mem_cgroup->tcpmem);
 		/*
-		 * Deeper hierachy with use_hierarchy == false doesn't make
+		 * Hierachy with use_hierarchy == false doesn't make
 		 * much sense so let cgroup subsystem know about this
 		 * unfortunate state in our controller.
 		 */
-		if (parent != root_mem_cgroup)
-			memory_cgrp_subsys.broken_hierarchy = true;
+		memory_cgrp_subsys.broken_hierarchy = true;
 	}
 
 	/* The following stuff does not apply to the root */

What do you think?

Michal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://lists.linux.it/pipermail/ltp/attachments/20201029/2f652345/attachment.sig>

WARNING: multiple messages have this Message-ID (diff)
From: "Michal Koutný" <mkoutny@suse.com>
To: Roman Gushchin <guro@fb.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Shakeel Butt <shakeelb@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	kernel-team@fb.com, ltp@lists.linux.it,
	Richard Palethorpe <rpalethorpe@suse.com>,
	stable@vger.kernel.org
Subject: Re: [PATCH v2] mm: memcg: link page counters to root if use_hierarchy is false
Date: Thu, 29 Oct 2020 16:39:21 +0100	[thread overview]
Message-ID: <20201029153921.GC9928@blackbook> (raw)
In-Reply-To: <20201026231326.3212225-1-guro@fb.com>

[-- Attachment #1: Type: text/plain, Size: 1355 bytes --]

Hi.

On Mon, Oct 26, 2020 at 04:13:26PM -0700, Roman Gushchin <guro@fb.com> wrote:
> Please note, that in the non-hierarchical mode all objcgs are always
> reparented to the root memory cgroup, even if the hierarchy has more
> than 1 level. This patch doesn't change it.
> 
> The patch also doesn't affect how the hierarchical mode is working,
> which is the only sane and truly supported mode now.
I agree with the patch and you can add
Reviewed-by: Michal Koutný <mkoutny@suse.com>

However, it effectively switches any users of root.use_hierarchy=0 (if there
are any, watching the counters of root memcg) into root.use_hierarchy=1.
So I'd show them the warning even with a single level of cgroups, i.e.
add this hunk

@@ -5356,12 +5356,11 @@
 		page_counter_init(&memcg->kmem, &root_mem_cgroup->kmem);
 		page_counter_init(&memcg->tcpmem, &root_mem_cgroup->tcpmem);
 		/*
-		 * Deeper hierachy with use_hierarchy == false doesn't make
+		 * Hierachy with use_hierarchy == false doesn't make
 		 * much sense so let cgroup subsystem know about this
 		 * unfortunate state in our controller.
 		 */
-		if (parent != root_mem_cgroup)
-			memory_cgrp_subsys.broken_hierarchy = true;
+		memory_cgrp_subsys.broken_hierarchy = true;
 	}
 
 	/* The following stuff does not apply to the root */

What do you think?

Michal

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-10-29 15:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 23:13 [LTP] [PATCH v2] mm: memcg: link page counters to root if use_hierarchy is false Roman Gushchin
2020-10-26 23:13 ` Roman Gushchin
2020-10-29 15:39 ` Michal =?unknown-8bit?q?Koutn=C3=BD?= [this message]
2020-10-29 15:39   ` Michal Koutný
2020-10-29 17:05   ` [LTP] " Roman Gushchin
2020-10-29 17:05     ` Roman Gushchin

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=20201029153921.GC9928@blackbook \
    --to=mkoutny@suse.com \
    --cc=ltp@lists.linux.it \
    /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.