lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 15 Apr 2008 11:07:05 +0900
From:	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To:	Li Zefan <lizf@...fujitsu.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	"balbir@...ux.vnet.ibm.com" <balbir@...ux.vnet.ibm.com>,
	"xemul@...nvz.org" <xemul@...nvz.org>, menage@...gle.com,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] use vmalloc for mem_cgroup allocation.

On Tue, 15 Apr 2008 09:57:17 +0800
Li Zefan <lizf@...fujitsu.com> wrote:

> >  #include <asm/uaccess.h>
> >  
> > @@ -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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ