linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC] slub: ARCH_SLAB_MINALIGN defaults to 8 on x86_32. is this too big?
@ 2010-02-03 14:22 Richard Kennedy
  2010-02-03 15:41 ` Christoph Lameter
  2010-02-04  0:07 ` Paul Mundt
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Kennedy @ 2010-02-03 14:22 UTC (permalink / raw)
  To: Christoph Lameter, penberg, Ingo Molnar, Thomas Gleixner; +Cc: lkml, linux-mm

Hi all,

slub.c sets the default value of ARCH_SLAB_MINALIGN to sizeof(unsigned
long long) if the architecture didn't already override it.

And as x86_32 doesn't set a value this means that slab objects get
aligned to 8 bytes, potentially wasting 4 bytes per object. Slub forces
objects to be aligned to sizeof(void *) anyway, but I don't see that
there is any need for it to be 8 on 32bits.

I'm working on a patch to pack more buffer_heads into each kmem_cache
slab page.
On 32 bits the structure size is 52 bytes and with the alignment applied
I end up with a slab of 73 x 56 byte objects. However, if the minimum
alignment was sizeof(void *) then I'd get 78 x 52 byte objects. So there
is quite a memory saving to be had in changing this.

Can I define a ARCH_SLAB_MINALIGN in x86_64 to sizeof(void *) ? 
or would it be ok to change the default in slub.c to sizeof(void *) ?

Or am I missing something ?

regards
Richard


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-02-04 16:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-03 14:22 [RFC] slub: ARCH_SLAB_MINALIGN defaults to 8 on x86_32. is this too big? Richard Kennedy
2010-02-03 15:41 ` Christoph Lameter
2010-02-03 17:25   ` Richard Kennedy
2010-02-04 16:42     ` Christoph Lameter
2010-02-04  0:07 ` Paul Mundt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).