From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 3 May 2007 10:35:35 -0700 (PDT) From: Christoph Lameter Subject: SLUB: Change default alignments Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org Return-Path: To: akpm@linux-foundation.org Cc: David Woodhouse , penberg@cs.helsinki.fi, linux-mm@kvack.org List-ID: 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 --- mm/slub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: slub/mm/slub.c =================================================================== --- slub.orig/mm/slub.c 2007-05-03 10:24:41.000000000 -0700 +++ slub/mm/slub.c 2007-05-03 10:26:04.000000000 -0700 @@ -154,11 +154,11 @@ SLAB_CACHE_DMA) #ifndef ARCH_KMALLOC_MINALIGN -#define ARCH_KMALLOC_MINALIGN sizeof(void *) +#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long) #endif #ifndef ARCH_SLAB_MINALIGN -#define ARCH_SLAB_MINALIGN sizeof(void *) +#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long) #endif /* Internal SLUB flags */ -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org