mm/memcg: non-hierarchical mode is deprecated
Subsystems (3)
PATCH 1/1 mm/memcg: non-hierarchical mode is deprecated
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).
--- mm/memcontrol.c | 3 --- 1 file changed, 3 deletions(-)
mm/memcontrol.c +0 -3
@@ -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);
Signature · 1 line
2.33.1
Quoted 7 lines · Wei Yang
After commit
bef8620cd8e0("mm: memcg: deprecate the non-hierarchical mode"), we won't have a NULL parent exceptroot_mem_cgroup. And this case is handled when (memcg == root).Signed-off-by Wei Yang <[email protected]>CC Roman Gushchin <[email protected]>CC Johannes Weiner <[email protected]>
Thanks!
Quoted 20 lines
--- mm/memcontrol.c | 3 --- 1 file changed, 3 deletions(-)mm/memcontrol.c +0
-3@@ -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);Signature · 1 line
2.33.1
Signature · 2 lines
Michal Hocko SUSE Labs
Quoted 5 lines · Michal Hocko
Quoted 4 lines · Wei Yang
After commit
bef8620cd8e0("mm: memcg: deprecate the non-hierarchical mode"), we won't have a NULL parent exceptroot_mem_cgroup. And this case is handled when (memcg == root).
Quoted 7 lines
Quoted 3 lines
Signed-off-by Wei Yang <[email protected]>CC Roman Gushchin <[email protected]>CC Johannes Weiner <[email protected]>Thanks!
Thanks for the ack. When reading the code, I found one redundant check in shrink_node_memcgs().
shrink_node_memcgs
mem_cgroup_below_min
mem_cgroup_supports_protection
mem_cgroup_below_low
mem_cgroup_supports_protection
I am not sure it worthwhile to take it out.
shrink_node_memcgs
mem_cgroup_supports_protection
mem_cgroup_below_min
mem_cgroup_below_low
Look forward your opinion.
Signature · 2 lines
Wei Yang Help you, Help me
Quoted 23 lines · Wei Yang
Quoted 5 lines · Michal Hocko
Quoted 4 lines · Wei Yang
After commit
bef8620cd8e0("mm: memcg: deprecate the non-hierarchical mode"), we won't have a NULL parent exceptroot_mem_cgroup. And this case is handled when (memcg == root).Quoted 7 lines
Quoted 3 lines
Signed-off-by Wei Yang <[email protected]>CC Roman Gushchin <[email protected]>CC Johannes Weiner <[email protected]>Thanks!
Thanks for the ack. When reading the code, I found one redundant check in
shrink_node_memcgs().
shrink_node_memcgs
mem_cgroup_below_min
mem_cgroup_supports_protection
mem_cgroup_below_low
mem_cgroup_supports_protection
Quoted 8 lines
I am not sure it worthwhile to take it out.
shrink_node_memcgs
mem_cgroup_supports_protection
mem_cgroup_below_min
mem_cgroup_below_lowLook forward your opinion.
I guess you refer to mem_cgroup_is_root check in mem_cgroup_supports_protection, right?
You are right that the check is not really required because e{min,low} should always stay at 0 for the root memcg AFAICS. On the other hand the check is not in any hot path and it really adds clarity here because protection is not really supported on the root memcg. So I am not this is an overall win.
Signature · 2 lines
Michal Hocko SUSE Labs
Quoted 33 lines · Michal Hocko
Quoted 23 lines · Wei Yang
Quoted 5 lines · Michal Hocko
Quoted 4 lines · Wei Yang
After commit
bef8620cd8e0("mm: memcg: deprecate the non-hierarchical mode"), we won't have a NULL parent exceptroot_mem_cgroup. And this case is handled when (memcg == root).Quoted 7 lines
Quoted 3 lines
Signed-off-by Wei Yang <[email protected]>CC Roman Gushchin <[email protected]>CC Johannes Weiner <[email protected]>Thanks!
Thanks for the ack. When reading the code, I found one redundant check in
shrink_node_memcgs().
shrink_node_memcgs
mem_cgroup_below_min
mem_cgroup_supports_protection
mem_cgroup_below_low
mem_cgroup_supports_protectionQuoted 8 lines
I am not sure it worthwhile to take it out.
shrink_node_memcgs
mem_cgroup_supports_protection
mem_cgroup_below_min
mem_cgroup_below_lowLook forward your opinion.
Quoted 8 lines
I guess you refer to
mem_cgroup_is_rootcheck inmem_cgroup_supports_protection, right?You are right that the check is not really required because e{min,low} should always stay at 0 for the root memcg AFAICS. On the other hand the check is not in any hot path and it really adds clarity here because protection is not really supported on the root memcg. So I am not this is an overall win.
Agree.
Quoted 3 lines
Signature · 2 lines
Michal Hocko SUSE Labs
Signature · 2 lines
Wei Yang Help you, Help me
Quoted 7 lines · Wei Yang
After commit
bef8620cd8e0("mm: memcg: deprecate the non-hierarchical mode"), we won't have a NULL parent exceptroot_mem_cgroup. And this case is handled when (memcg == root).Signed-off-by Wei Yang <[email protected]>CC Roman Gushchin <[email protected]>CC Johannes Weiner <[email protected]>
Thanks!
Quoted 21 lines
--- mm/memcontrol.c | 3 --- 1 file changed, 3 deletions(-)mm/memcontrol.c +0
-3@@ -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);Signature · 1 line
2.33.1
Quoted 7 lines · Wei Yang
After commit
bef8620cd8e0("mm: memcg: deprecate the non-hierarchical mode"), we won't have a NULL parent exceptroot_mem_cgroup. And this case is handled when (memcg == root).Signed-off-by Wei Yang <[email protected]>CC Roman Gushchin <[email protected]>CC Johannes Weiner <[email protected]>