>From 86c7fe861b4a6ee7b533a25ce2c506134a7533a8 Mon Sep 17 00:00:00 2001 From: Giuseppe Cavallaro Date: Fri, 13 Feb 2009 15:06:22 +0100 Subject: [PATCH] slab: fix the debug information with different alignments. This patch is to fix the debug information reported in /proc/slab_allocators for all the architectures by using a new define (ARCH_SLAB_MAX_DEBUG_ALIGN) rather than the alignment of a 64-bit integer. Currently, on sh, for example, /proc/slab_allocators has no size-X entries as side effect. Signed-off-by: Giuseppe Cavallaro --- mm/slab.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/mm/slab.c b/mm/slab.c index 4d00855..587e0f3 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -165,6 +165,10 @@ #define ARCH_SLAB_MINALIGN 0 #endif +#ifndef ARCH_SLAB_MAX_DEBUG_ALIGN +#define ARCH_SLAB_MAX_DEBUG_ALIGN __alignof__(unsigned long long) +#endif + #ifndef ARCH_KMALLOC_FLAGS #define ARCH_KMALLOC_FLAGS SLAB_HWCACHE_ALIGN #endif @@ -2262,7 +2266,7 @@ kmem_cache_create (const char *name, size_t size, size_t align, ralign = align; } /* disable debug if necessary */ - if (ralign > __alignof__(unsigned long long)) + if (ralign > ARCH_SLAB_MAX_DEBUG_ALIGN) flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER); /* * 4) Store it. -- 1.5.6.6