Re: [BUG] SLOB breaks Crypto

From: David Woodhouse
Date: Tue May 18 2010 - 19:21:21 EST


On Tue, 2010-05-18 at 14:20 -0700, David Miller wrote:
> I think it does make sense to expect that, whatever my architecture
> defines or does not define, I can expect the allocators to provide the
> same minimum alignment guarentee.

In a sense, they do. The minimum alignment guarantee is sizeof(long).
You are guaranteed that no allocator will return memory blocks which are
aligned to anything less than that.

Some allocators may sometimes return memory blocks which are
better-aligned than that -- but that's not guaranteed behaviour. If you
_depend_ on that behaviour and it happens to vary with the phase of the
moon, that's your problem.

It would be better if the minimum alignment was exposed to generic code
though -- you're right that the CPP tests in linux/crypto.h really
shouldn't have to exist. If it wasn't for that, then the crypto problem
wouldn't have occurred.

--
David Woodhouse Open Source Technology Centre
David.Woodhouse@xxxxxxxxx Intel Corporation

--
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/