linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/memcg: non-hierarchical mode is deprecated
@ 2022-04-03  2:08 Wei Yang
  2022-04-04  9:27 ` Michal Hocko
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Wei Yang @ 2022-04-03  2:08 UTC (permalink / raw)
  To: akpm; +Cc: cgroups, linux-mm, Wei Yang, Roman Gushchin, Johannes Weiner

After commit bef8620cd8e0 ("mm: memcg: deprecate the non-hierarchical
mode"), we won't have a NULL parent except root_mem_cgroup. And this
case is handled when (memcg == root).

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Roman Gushchin <roman.gushchin@linux.dev>
CC: Johannes Weiner <hannes@cmpxchg.org>
---
 mm/memcontrol.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 2cd8bfdec379..3ceb9b8592b1 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6587,9 +6587,6 @@ void mem_cgroup_calculate_protection(struct mem_cgroup *root,
 		return;
 
 	parent = parent_mem_cgroup(memcg);
-	/* No parent means a non-hierarchical mode on v1 memcg */
-	if (!parent)
-		return;
 
 	if (parent == root) {
 		memcg->memory.emin = READ_ONCE(memcg->memory.min);
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-04-05 18:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-03  2:08 [PATCH] mm/memcg: non-hierarchical mode is deprecated Wei Yang
2022-04-04  9:27 ` Michal Hocko
2022-04-05  2:22   ` Wei Yang
2022-04-05  6:26     ` Michal Hocko
2022-04-05  8:05       ` Wei Yang
2022-04-04 19:11 ` Roman Gushchin
2022-04-05 18:20 ` Shakeel Butt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).