From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 15 Apr 2008 11:07:05 +0900 From: KAMEZAWA Hiroyuki Subject: Re: [PATCH] use vmalloc for mem_cgroup allocation. Message-Id: <20080415110705.794aa543.kamezawa.hiroyu@jp.fujitsu.com> In-Reply-To: <48040B7D.4040708@cn.fujitsu.com> References: <20080415105434.3044afb6.kamezawa.hiroyu@jp.fujitsu.com> <48040B7D.4040708@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org Return-Path: To: Li Zefan Cc: Andrew Morton , "balbir@linux.vnet.ibm.com" , "xemul@openvz.org" , menage@google.com, "linux-mm@kvack.org" , LKML List-ID: On Tue, 15 Apr 2008 09:57:17 +0800 Li Zefan wrote: > > #include > > > > @@ -993,7 +994,7 @@ mem_cgroup_create(struct cgroup_subsys * > > mem = &init_mem_cgroup; > > page_cgroup_cache = KMEM_CACHE(page_cgroup, SLAB_PANIC); > > } else > > - mem = kzalloc(sizeof(struct mem_cgroup), GFP_KERNEL); > > + mem = vmalloc(sizeof(struct mem_cgroup)); > > > > memset(mem, 0, sizeof(*mem)); > ok, will rewrite. > should we initialize it with 0? > yes. (at least, per-cpu stat. mem->css, per-node pointer, ... should be zero.) Thanks, -Kame > > if (mem == NULL) > > return ERR_PTR(-ENOMEM); > > @@ -1011,7 +1012,7 @@ free_out: > > for_each_node_state(node, N_POSSIBLE) > > free_mem_cgroup_per_zone_info(mem, node); > > if (cont->parent != NULL) > > - kfree(mem); > > + vfree(mem); > > return ERR_PTR(-ENOMEM); > > } > > > > @@ -1031,7 +1032,7 @@ static void mem_cgroup_destroy(struct cg > > for_each_node_state(node, N_POSSIBLE) > > free_mem_cgroup_per_zone_info(mem, node); > > > > - kfree(mem_cgroup_from_cont(cont)); > > + vfree(mem_cgroup_from_cont(cont)); > > } > > > > static int mem_cgroup_populate(struct cgroup_subsys *ss, > > > > > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org