Re: [PATCH] mm-slab: allocate kmem_cache with __GFP_REPEAT

From: Eric Dumazet
Date: Wed Jul 20 2011 - 12:31:22 EST

Le mercredi 20 juillet 2011 Ã 11:17 -0500, Christoph Lameter a Ãcrit :
> On Wed, 20 Jul 2011, Eric Dumazet wrote:
> > Note that adding ____cacheline_aligned_in_smp on nodelists[] actually
> > helps performance, as all following fields are readonly after kmem_cache
> > setup.
> Well but that is not addresssing the same issue. Could you separate that
> out?

I would like this patch not being a performance regression. I know some
people really want fast SLAB/SLUB ;)

> The other question that follows from this is then: Does that
> alignment compensate for the loss of performance due to the additional
> lookup in hot code paths and the additional cacheline reference required?

In fact resulting code is smaller, because most fields are now with <
127 offset (x86 assembly code can use shorter instructions)

Before patch :
# size mm/slab.o
text data bss dec hex filename
22605 361665 32 384302 5dd2e mm/slab.o

After patch :
# size mm/slab.o
text data bss dec hex filename
22347 328929 32800 384076 5dc4c mm/slab.o

> The per node pointers are lower priority in terms of performance than the
> per cpu pointers. I'd rather have the per node pointers requiring an
> additional lookup. Less impact on hot code paths.

Sure. I'll post a V2 to have CPU array before NODE array.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at