[Devel] [RFC][for -mm] memory controller enhancements for reclaiming take2 [3/8] define free_mem_cgroup_per_zone_info
KAMEZAWA Hiroyuki
kamezawa.hiroyu at jp.fujitsu.com
Mon Dec 3 01:37:19 PST 2007
Now allocation of per_zone of mem_controller is done by
alloc_mem_cgroup_per_zone_info(). Then it will be good to use
free_mem_cgroup_per_zone_info() for maintainance.
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu at jp.fujitsu.com>
mm/memcontrol.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Index: linux-2.6.24-rc3-mm2/mm/memcontrol.c
===================================================================
--- linux-2.6.24-rc3-mm2.orig/mm/memcontrol.c
+++ linux-2.6.24-rc3-mm2/mm/memcontrol.c
@@ -1141,6 +1141,11 @@ static int alloc_mem_cgroup_per_zone_inf
return 0;
}
+static void free_mem_cgroup_per_zone_info(struct mem_cgroup *mem, int node)
+{
+ kfree(mem->info.nodeinfo[node]);
+}
+
static struct mem_cgroup init_mem_cgroup;
@@ -1171,7 +1176,7 @@ mem_cgroup_create(struct cgroup_subsys *
return &mem->css;
free_out:
for_each_node_state(node, N_POSSIBLE)
- kfree(mem->info.nodeinfo[node]);
+ free_mem_cgroup_per_zone_info(mem, node);
if (cont->parent != NULL)
kfree(mem);
return NULL;
@@ -1191,7 +1196,7 @@ static void mem_cgroup_destroy(struct cg
struct mem_cgroup *mem = mem_cgroup_from_cont(cont);
for_each_node_state(node, N_POSSIBLE)
- kfree(mem->info.nodeinfo[node]);
+ free_mem_cgroup_per_zone_info(mem, node);
kfree(mem_cgroup_from_cont(cont));
}
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
More information about the Devel
mailing list