Re: [rfc][patch 2/3] slab: introduce SMP alignment

Christoph Lameter
2008-03-03T21:26:00Z

On Mon, 3 Mar 2008, Pekka Enberg wrote:

> Hmm... Can't we just fix SLAB_HWCACHE_ALIGN in SLUB to follow the
> semantics of SLAB?

AFAICT it follows SLAB semantics. The only small difference is for objects
small than cache_line_size() / 2 where SLUB does not bother to align to a
fraction of a cacheline since we are already placing multile object into a
cacheline. We effectively have made the decision to give up the
organization of objects in separatate cache lines.

Lets say you have a 64 byte cache line size. Then the alignment can be
as follows. (8 byte alignment is the basic alignment requirement).

Objsize [C SLAB SLUB
-----------------------------
> 64 X X
33 .. 64 64 64
32 32 32
24 32 24 -> 3 object per cacheline sizes = 72 so overlap.
16 16 16
8 8 8

So there is only one difference for 24 byte sizes slabs.