Re: slab-alignment-rework.patch in -mc

From: Andrew Morton
Date: Tue Apr 20 2004 - 02:28:01 EST

Manfred Spraul <manfred@xxxxxxxxxxxxxxxx> wrote:
> > No best-guess must
> >be made automatically by the slab code, rounding it to 16 bytes.
> >
> If you pass 0 as align to kmem_cache_create, then it's rounded to L2
> size. It's questionable if that's really the best thing - on
> uniprocessor, 16-byte might result is better performance - there is no
> risk of false sharing.

Just about every time we've cared to investigate slab alignment, we've
ended up removing SLAB_HWCACHE_ALIGN. It seems inappropriate that _any_ of
the inode caches have this set, for example.

And this patch appears to have taken the effective size of the buffer_head
from 48 bytes up to 64, which hurts.

So I do think that we should either make "align=0" translate to "pack them
densely" or do the big sweep across all kmem_cache_create() callsites.

If the latter, while we're there, let's remove SLAB_HWCACHE_ALIGN where it
isn't obviously appropriate. I'd imagine that being able to fit more inodes
into memory is a net win over the occasional sharing effect, for example.
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