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

From: Christoph Lameter
Date: Mon Mar 03 2008 - 16:26:03 EST


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.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/