diff options
author | Christoph Lameter <clameter@sgi.com> | 2007-05-06 17:49:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 15:12:53 -0400 |
commit | 47bfdc0d5a18a4b760ffb6a332932aaa5c0859e0 (patch) | |
tree | 721dc3790b5300bad8ca2c011e02f210d5a20bfc /mm/slub.c | |
parent | 81819f0fc8285a2a5a921c019e3e3d7b6169d225 (diff) |
SLUB: change default alignments
Structures may contain u64 items on 32 bit platforms that are only able to
address 64 bit items on 64 bit boundaries. Change the mininum alignment of
slabs to conform to those expectations.
ARCH_KMALLOC_MINALIGN must be changed for good since a variety of structure
are mixed in the general slabs.
ARCH_SLAB_MINALIGN is changed because currently there is no consistent
specification of object alignment. We may have that in the future when the
KMEM_CACHE and related macros are used to generate slabs. These pass the
alignment of the structure generated by the compiler to the slab.
With KMEM_CACHE etc we could align structures that do not contain 64
bit values to 32 bit boundaries potentially saving some memory.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -145,11 +145,11 @@ | |||
145 | SLAB_CACHE_DMA) | 145 | SLAB_CACHE_DMA) |
146 | 146 | ||
147 | #ifndef ARCH_KMALLOC_MINALIGN | 147 | #ifndef ARCH_KMALLOC_MINALIGN |
148 | #define ARCH_KMALLOC_MINALIGN sizeof(void *) | 148 | #define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long) |
149 | #endif | 149 | #endif |
150 | 150 | ||
151 | #ifndef ARCH_SLAB_MINALIGN | 151 | #ifndef ARCH_SLAB_MINALIGN |
152 | #define ARCH_SLAB_MINALIGN sizeof(void *) | 152 | #define ARCH_SLAB_MINALIGN __alignof__(unsigned long long) |
153 | #endif | 153 | #endif |
154 | 154 | ||
155 | /* Internal SLUB flags */ | 155 | /* Internal SLUB flags */ |