Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-02 Thread Drokin, Oleg
Hello! On May 2, 2015, at 4:14 AM, Dan Carpenter wrote: > On Fri, May 01, 2015 at 09:13:11PM +, Drokin, Oleg wrote: The patch was submitted. But it depends on a symbol that's not exported. I was not able to change that. http://www.spinics.net/lists/linux-mm/msg83997.html >

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-02 Thread Julia Lawall
On Sat, 2 May 2015, Dan Carpenter wrote: > On Fri, May 01, 2015 at 09:13:11PM +, Drokin, Oleg wrote: > > >> The patch was submitted. > > >> But it depends on a symbol that's not exported. > > >> I was not able to change that. > > >> http://www.spinics.net/lists/linux-mm/msg83997.html > > >

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-02 Thread Dan Carpenter
On Fri, May 01, 2015 at 09:13:11PM +, Drokin, Oleg wrote: > >> The patch was submitted. > >> But it depends on a symbol that's not exported. > >> I was not able to change that. > >> http://www.spinics.net/lists/linux-mm/msg83997.html > > > > But you were given a hint on how to change that :) >

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
> Yes, I imagine Julia will include that as the new lustre_kvzalloc() define > to be used in all OBD_ALLOC_LARGE instances. > I can provide the desired code if necessary (it's actually a bit less than > trivial > because in some cases we also have that numa-aware node thing). Oleg, If you could

RE: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Simmons, James A.
>> Yes the LARGE functions do the switching. I was expecting also patches to >> remove the >> OBD_ALLOC_LARGE functions as well which is not the case here. I do have one >> question still. The >> macro __OBD_MALLOC_VERBOSE allowed the ability to simulate memory allocation >> failures at >> a c

RE: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Simmons, James A.
>> Yes the LARGE functions do the switching. I was expecting also patches to >> remove the >> OBD_ALLOC_LARGE functions as well which is not the case here. I do have one >> question still. The >> macro __OBD_MALLOC_VERBOSE allowed the ability to simulate memory allocation >> failures at >> a c

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Drokin, Oleg
On May 1, 2015, at 4:58 PM, Greg Kroah-Hartman wrote: > On Fri, May 01, 2015 at 08:52:37PM +, Drokin, Oleg wrote: >> >> On May 1, 2015, at 4:49 PM, Greg Kroah-Hartman wrote: >> >>> On Fri, May 01, 2015 at 08:36:05PM +, Simmons, James A. wrote: > We are hopefully going to get rid of

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Greg Kroah-Hartman
On Fri, May 01, 2015 at 08:52:37PM +, Drokin, Oleg wrote: > > On May 1, 2015, at 4:49 PM, Greg Kroah-Hartman wrote: > > > On Fri, May 01, 2015 at 08:36:05PM +, Simmons, James A. wrote: > >>> We are hopefully going to get rid of OBD_ALLOC_LARGE() as well, though. > >>> > >>> It's simple e

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Drokin, Oleg
On May 1, 2015, at 4:49 PM, Greg Kroah-Hartman wrote: > On Fri, May 01, 2015 at 08:36:05PM +, Simmons, James A. wrote: >>> We are hopefully going to get rid of OBD_ALLOC_LARGE() as well, though. >>> >>> It's simple enough to write a function: >>> >>> void *obd_zalloc(size_t size) >>> { >>>

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Greg Kroah-Hartman
On Fri, May 01, 2015 at 08:36:05PM +, Simmons, James A. wrote: > >We are hopefully going to get rid of OBD_ALLOC_LARGE() as well, though. > > > >It's simple enough to write a function: > > > >void *obd_zalloc(size_t size) > >{ > > if (size > 4 * PAGE_CACHE_SIZE) > > return vzall

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Drokin, Oleg
On May 1, 2015, at 4:18 PM, Simmons, James A. wrote: > Yes the LARGE functions do the switching. I was expecting also patches to > remove the > OBD_ALLOC_LARGE functions as well which is not the case here. I do have one > question still. The > macro __OBD_MALLOC_VERBOSE allowed the ability to

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Greg Kroah-Hartman
On Fri, May 01, 2015 at 08:18:56PM +, Simmons, James A. wrote: > >> >From: Julia Lawall > >> > > >> >Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT > >> >by > >> >kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. > >> > >> Nak: James Simmons > >> > >> A simp

RE: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Simmons, James A.
>We are hopefully going to get rid of OBD_ALLOC_LARGE() as well, though. > >It's simple enough to write a function: > >void *obd_zalloc(size_t size) >{ > if (size > 4 * PAGE_CACHE_SIZE) > return vzalloc(size); > else > return kmalloc(size, GFP_NOFS); >} > >Ex

RE: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Simmons, James A.
>> >From: Julia Lawall >> > >> >Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by >> >kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. >> >> Nak: James Simmons >> >> A simple replace will not work. The OBD_ALLOC and OBD_FREE functions >> allocate memory >> anyw

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Drokin, Oleg
On May 1, 2015, at 4:02 PM, Dan Carpenter wrote: > We are hopefully going to get rid of OBD_ALLOC_LARGE() as well, though. > > It's simple enough to write a function: > > void *obd_zalloc(size_t size) > { > if (size > 4 * PAGE_CACHE_SIZE) > return vzalloc(size); > else

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Dan Carpenter
We are hopefully going to get rid of OBD_ALLOC_LARGE() as well, though. It's simple enough to write a function: void *obd_zalloc(size_t size) { if (size > 4 * PAGE_CACHE_SIZE) return vzalloc(size); else return kmalloc(size, GFP_NOFS); } Except, huh

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Drokin, Oleg
Hello! On May 1, 2015, at 1:48 PM, Julia Lawall wrote: >>> From: Julia Lawall >>> >>> Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by >>> kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. >> >> Nak: James Simmons >> >> A simple replace will not work. The OBD_

Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Greg Kroah-Hartman
On Fri, May 01, 2015 at 05:38:49PM +, Simmons, James A. wrote: > >From: Julia Lawall > > > >Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by > >kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. > > Nak: James Simmons > > A simple replace will not work. The O

RE: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Simmons, James A.
>From: Julia Lawall > >Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by >kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. Nak: James Simmons A simple replace will not work. The OBD_ALLOC and OBD_FREE functions allocate memory anywhere from one page to 4MB in s

RE: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
On Fri, 1 May 2015, Simmons, James A. wrote: > >From: Julia Lawall > > > >Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by > >kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. > > Nak: James Simmons > > A simple replace will not work. The OBD_ALLOC and OBD_FREE

[PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree

2015-05-01 Thread Julia Lawall
From: Julia Lawall Replace OBD_ALLOC, OBD_ALLOC_WAIT, OBD_ALLOC_PTR, and OBD_ALLOC_PTR_WAIT by kalloc/kcalloc, and OBD_FREE and OBD_FREE_PTR by kfree. A simplified version of the semantic patch that makes these changes is as follows: (http://coccinelle.lip6.fr/) // @@ expression ptr,size; @@ -