Re: [patch 05/26] Slab allocators: Cleanup zeroing allocations

2007-06-19 Thread Pekka J Enberg
On Tue, 19 Jun 2007, Matt Mackall wrote: > > I worry a bit about adding another branch checking __GFP_ZERO in such > > a hot path for SLAB/SLUB. On Tue, 19 Jun 2007, Christoph Lameter wrote: > Its checking the gfpflags variable on the stack. In a recently touched > cachline. The variable could b

Re: [patch 05/26] Slab allocators: Cleanup zeroing allocations

2007-06-19 Thread Christoph Lameter
On Tue, 19 Jun 2007, Matt Mackall wrote: > I worry a bit about adding another branch checking __GFP_ZERO in such > a hot path for SLAB/SLUB. Its checking the gfpflags variable on the stack. In a recently touched cachline. - To unsubscribe from this list: send the line "unsubscribe linux-kernel

Re: [patch 05/26] Slab allocators: Cleanup zeroing allocations

2007-06-19 Thread Matt Mackall
On Mon, Jun 18, 2007 at 02:58:43AM -0700, [EMAIL PROTECTED] wrote: > It becomes now easy to support the zeroing allocs with generic inline > functions > in slab.h. Provide inline definitions to allow the continued use of > kzalloc, kmem_cache_zalloc etc but remove other definitions of zeroing > f

Re: [patch 05/26] Slab allocators: Cleanup zeroing allocations

2007-06-18 Thread Pekka Enberg
On 6/19/2007, "Christoph Lameter" <[EMAIL PROTECTED]> wrote: > IA64 [snip] > Saved ~500 bytes in text size. > > x86_64: [snip] > 200 bytes saved. Looks good. Thanks Christoph. Acked-by: Pekka Enberg <[EMAIL PROTECTED]> - To unsubscribe from this list: send the line "unsubscribe linux-kernel

Re: [patch 05/26] Slab allocators: Cleanup zeroing allocations

2007-06-18 Thread Christoph Lameter
On Mon, 18 Jun 2007, Pekka Enberg wrote: > On 6/18/07, Pekka Enberg <[EMAIL PROTECTED]> wrote: > > Hmm, did you check kernel text size before and after this change? > > Setting the __GFP_ZERO flag at every kzalloc call-site seems like a > > bad idea. > > Aah but most call-sites, of course, use co

Re: [patch 05/26] Slab allocators: Cleanup zeroing allocations

2007-06-18 Thread Christoph Lameter
On Mon, 18 Jun 2007, Pekka Enberg wrote: > On 6/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > +static inline void *kmem_cache_zalloc(struct kmem_cache *k, gfp_t flags) > > +{ > > + return kmem_cache_alloc(k, flags | __GFP_ZERO); > > +} > > + > > +static inline void *__kzalloc(int s

Re: [patch 05/26] Slab allocators: Cleanup zeroing allocations

2007-06-18 Thread Pekka Enberg
On 6/18/07, Pekka Enberg <[EMAIL PROTECTED]> wrote: Hmm, did you check kernel text size before and after this change? Setting the __GFP_ZERO flag at every kzalloc call-site seems like a bad idea. Aah but most call-sites, of course, use constants such as GFP_KERNEL only which should be folded ni

Re: [patch 05/26] Slab allocators: Cleanup zeroing allocations

2007-06-18 Thread Pekka Enberg
On 6/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: +static inline void *kmem_cache_zalloc(struct kmem_cache *k, gfp_t flags) +{ + return kmem_cache_alloc(k, flags | __GFP_ZERO); +} + +static inline void *__kzalloc(int size, gfp_t flags) +{ + return kmalloc(size, flags | __GFP_ZE