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@xxxxxxxxx> CC: Roman Gushchin <roman.gushchin@xxxxxxxxx> CC: Johannes Weiner <hannes@xxxxxxxxxxx> --- 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