[Devel] [PATCH RHEL7 COMMIT] mm/memcg: initialize mem_cgroup_per_zone_info earlier - compilation fix

Konstantin Khorenko khorenko at virtuozzo.com
Mon Mar 4 18:53:08 MSK 2019


The commit is pushed to "branch-rh7-3.10.0-957.5.1.vz7.84.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-957.5.1.vz7.84.4
------>
commit 58d7251cb0a9f290283c8b924b59f2af407dec66
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Mon Mar 4 18:49:07 2019 +0300

    mm/memcg: initialize mem_cgroup_per_zone_info earlier - compilation fix
    
    We are going to have the following piece of code.
    
    memcg = mem_cgroup_from_id(memcgid)
    lruvec = mem_cgroup_zone_lruvec(zone, memcg);
    
    This currently cannot work because mem_cgroup_per_zone_info
    allocated and initialized after memcgid become visible:
    
    mem_cgroup_alloc():
            idr_replace(&mem_cgroup_idr, memcg, memcg->id);
    
    Move per zone info initialization earlier, before idr_replace().
    Same thing was done in upstream commit 0b8f73e1("mm: memcontrol: clean
     up alloc, online, offline, free functions") but I don't want
    to do full backport, hence this patch.
    
    Fixes: 1ab424b4ccb9 ("mm/memcg: initialize mem_cgroup_per_zone_info
    earlier.")
    https://jira.sw.ru/browse/PSBM-91933
    
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 mm/memcontrol.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 391ccf8e8699..33ca8ac4a4b3 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -6437,10 +6437,6 @@ mem_cgroup_css_alloc(struct cgroup *cont)
 #endif
 
 	return &memcg->css;
-
-free_out:
-	__mem_cgroup_free(memcg);
-	return ERR_PTR(error);
 }
 
 static int



More information about the Devel mailing list