OpenVZ Forum


Home » Mailing lists » Devel » Re: [PATCH] cgroup: Avoid a memset by using vzalloc
Re: [PATCH] cgroup: Avoid a memset by using vzalloc [message #41905] Wed, 03 November 2010 16:10 Go to next message
Christoph Lameter is currently offline  Christoph Lameter
Messages: 123
Registered: September 2006
Senior Member
On Wed, 3 Nov 2010, Joe Perches wrote:

> On Wed, 2010-11-03 at 23:20 +0800, jovi zhang wrote:
> > On Wed, Nov 3, 2010 at 10:38 PM, Christoph Lameter <cl@linux.com> wrote:
> > > On Mon, 1 Nov 2010, Jesper Juhl wrote:
> > >
> > >> On Sun, 31 Oct 2010, Balbir Singh wrote:
> > >
> > >> > > There are so many placed need vzalloc.
> > >> > > Thanks, Jesper.
> > >
> > >
> > > Could we avoid this painful exercise with a "semantic patch"?
>
> There's an existing cocci kmalloc/memset script.

I have it in
/usr/share/doc/coccinelle/examples/janitorings/kzalloc-orig. cocci.gz

(Ubuntu coccinelle package)

> Perhaps this is good enough?
>
> cp scripts/coccinelle/api/alloc/kzalloc-simple.cocci scripts/coccinelle/api/alloc/vzalloc-simple.cocci
> sed -i -e 's/kmalloc/vmalloc/g' -e 's/kzalloc/vzalloc/g' scripts/coccinelle/api/alloc/vzalloc-simple.cocci

Not sure if that is the same script but certainly a good start. Try it and
see if it catches all the locations that you know of?

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
Re: [PATCH] cgroup: Avoid a memset by using vzalloc [message #41971 is a reply to message #41905] Thu, 04 November 2010 21:43 Go to previous message
Jesper Juhl is currently offline  Jesper Juhl
Messages: 7
Registered: October 2010
Junior Member
On Wed, 3 Nov 2010, Christoph Lameter wrote:

> On Wed, 3 Nov 2010, Joe Perches wrote:
>
> > On Wed, 2010-11-03 at 23:20 +0800, jovi zhang wrote:
> > > On Wed, Nov 3, 2010 at 10:38 PM, Christoph Lameter <cl@linux.com> wrote:
> > > > On Mon, 1 Nov 2010, Jesper Juhl wrote:
> > > >
> > > >> On Sun, 31 Oct 2010, Balbir Singh wrote:
> > > >
> > > >> > > There are so many placed need vzalloc.
> > > >> > > Thanks, Jesper.
> > > >
> > > >
> > > > Could we avoid this painful exercise with a "semantic patch"?
> >
> > There's an existing cocci kmalloc/memset script.
>
> I have it in
> /usr/share/doc/coccinelle/examples/janitorings/kzalloc-orig. cocci.gz
>
> (Ubuntu coccinelle package)
>
> > Perhaps this is good enough?
> >
> > cp scripts/coccinelle/api/alloc/kzalloc-simple.cocci scripts/coccinelle/api/alloc/vzalloc-simple.cocci
> > sed -i -e 's/kmalloc/vmalloc/g' -e 's/kzalloc/vzalloc/g' scripts/coccinelle/api/alloc/vzalloc-simple.cocci
>
> Not sure if that is the same script but certainly a good start. Try it and
> see if it catches all the locations that you know of?
>

I'm aware of coccinelle, but I've never used it and it looks like it'll
take more than just a few hours to learn, so I'm sticking with
bash+egrep+manual inspection for now until I get a bit more time on my
hands to learn coccinelle/spatch.

I assume that not using spatch is not going to be an obstacle to patches
such as this one getting merged...?


--
Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
Plain text mails only, please http://www.expita.com/nomime.html
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containe rs
Previous Topic: [PATCH v2] cgroup: prefer [kv]zalloc[_node] over [kv]malloc+memset in memory controller code.
Next Topic: Re: Need help to debug freeze on kernel side (somehow related to lxc)
Goto Forum:
  


Current Time: Tue Jul 29 08:36:03 GMT 2025

Total time taken to generate the page: 0.28168 seconds