mm/memcg: mem_cgroup_per_node is already set to 0 on allocation
Subsystems (3)
PATCH 1/2 mm/memcg: mem_cgroup_per_node is already set to 0 on allocation
kzalloc_node() would set data to 0, so it's not necessary to set it again.
Signed-off-by Wei Yang <[email protected]>
Reviewed-by Muchun Song <[email protected]>
Reviewed-by Roman Gushchin <[email protected]>
Reviewed-by Mike Rapoport <[email protected]>
Reviewed-by Shakeel Butt <[email protected]>
--- mm/memcontrol.c | 2 -- 1 file changed, 2 deletions(-)
mm/memcontrol.c +0 -2
@@ -5070,8 +5070,6 @@ static int alloc_mem_cgroup_per_node_info(struct mem_cgroup *memcg, int node) }lruvec_init (&pn->lruvec); - pn->usage_in_excess =0 ; - pn->on_tree = false; pn->memcg = memcg; memcg->nodeinfo[node] = pn;
Signature · 1 line
2.33.1
PATCH 2/2 mm/memcg: retrieve parent memcg from css.parent
The parent we get from page_counter is correct, while this is two different hierarchy.
Let's retrieve the parent memcg from css.parent just like parent_cs(), blkcg_parent(), etc.
Signed-off-by Wei Yang <[email protected]>
Reviewed-by Muchun Song <[email protected]>
Reviewed-by Roman Gushchin <[email protected]>
Reviewed-by Shakeel Butt <[email protected]>
--- include/linux/memcontrol.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
include/linux/memcontrol.h +1 -3
@@ -886,9 +886,7 @@ static inline struct mem_cgroup *lruvec_memcg(struct lruvec *lruvec)*/ static inline struct mem_cgroup *parent_mem_cgroup (struct mem_cgroup *memcg) { -if (!memcg->memory.parent) -return NULL ; -return mem_cgroup_from_counter (memcg->memory.parent, memory); +return mem_cgroup_from_css (memcg->css.parent); } static inline bool mem_cgroup_is_descendant(struct mem_cgroup *memcg,
Signature · 1 line
2.33.1