memcg: use existing function to judge root mem cgroup
Subsystems (3)
PATCH 1/2 memcg: use existing function to judge root mem cgroup
From: Wanpeng Li <[email protected]>
Signed-off-by Wanpeng Li <[email protected]>
--- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memcontrol.c +1 -1
@@ -4873,7 +4873,7 @@ mem_cgroup_create(struct cgroup *cont) goto free_out;/* root ? */ -if (cont->parent ==NULL ) { +if (!(mem_cgroup_is_root (cont))) {int cpu;enable_swap_cgroup (); parent =NULL ;
Signature · 1 line
1.7.9.5
Quoted 12 lines · Wanpeng Li
From: Wanpeng Li <[email protected]>
Signed-off-by Wanpeng Li <[email protected]>--- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/memcontrol.c +0
-0
mm/memcontrol.c mem_cgroup_create(struct cgroup *cont) · line 4876
Quoted 5 lines
mm/memcontrol.c +1
-1@@ -4873,7 +4873,7 @@ mem_cgroup_create(struct cgroup *cont) goto free_out;/* root ? */ -if (cont->parent ==NULL ) { +if (!(mem_cgroup_is_root (cont))) {
This is not correct. mem_cgroup_is_root takes mem_cgroup and you are giving it cgroup, see?
Quoted 10 lines
mm/memcontrol.c +0
-0int cpu;enable_swap_cgroup (); parent =NULL ;Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe cgroups" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 6 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic
Johannes Weiner
maintainerQuoted 12 lines · Wanpeng Li
From: Wanpeng Li <[email protected]>
Signed-off-by Wanpeng Li <[email protected]>--- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/memcontrol.c +0
-0
mm/memcontrol.c mem_cgroup_create(struct cgroup *cont) · line 4876
Quoted 5 lines
mm/memcontrol.c +1
-1@@ -4873,7 +4873,7 @@ mem_cgroup_create(struct cgroup *cont) goto free_out;/* root ? */ -if (cont->parent ==NULL ) { +if (!(mem_cgroup_is_root (cont))) {
cont is struct cgroup *, but this function takes struct mem_cgroup *. The compiler should have warned you about this.