Re: Re: [patch] slab: always follow arch requested alignments

From: Christoph Lameter
Date: Wed Jul 26 2006 - 12:23:24 EST


On Wed, 26 Jul 2006, Pekka Enberg wrote:

> On 7/26/06, Christoph Lameter <clameter@xxxxxxx> wrote:
> > We intentionally discard the caller mandated alignment for debugging
> > purposes.
>
> Disagreed. The caller mandated alignment is not a hint. It is the
> required minimum alignment for objects.

This has been with the slab for a long time. Lots of alignments are now
ignored for the debugging case without a problem. Manfred intentionally
put that in. Alignments passed to kmem_cache_create are there for
performance reasons and not because unaligned object break the arch code.

> On 7/26/06, Christoph Lameter <clameter@xxxxxxx> wrote:
> > And it changes the basic way that slab debugging works.
>
> Look at kmem_cache_create, we turn off debugging for both caller and
> architecture mandated alignments already and the only reason we are
> not doing it for Heiko is because the architecture recommended default
> alignment is so large.

We discard alignment for FORCED_DEBUG unless

1. object size > 4096

2. If the object size would increase unreasonably.

I simply added another case. That preseves the discarding of alignment for
the FORCED_DEBUG case but allows an override if operations would be
impossible for not correctly aligned objects for certain caches (like in
the S/390 case).
-
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/