From 4c7bf8823ec5a05efd808f6076246d649deb79ef Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Wed, 6 Dec 2006 20:32:11 -0800 Subject: [PATCH] --- yaml --- r: 42656 b: refs/heads/master c: a44b56d354b49f9abb184e5a14f71889856283bb h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/mm/slab.c | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index c84c8a8c1b42..31c33fc447b3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cace673d376d97b0c66ffa0a49b8d588a696d5d2 +refs/heads/master: a44b56d354b49f9abb184e5a14f71889856283bb diff --git a/trunk/mm/slab.c b/trunk/mm/slab.c index 5de81473df34..ff60a94142f9 100644 --- a/trunk/mm/slab.c +++ b/trunk/mm/slab.c @@ -2197,18 +2197,17 @@ kmem_cache_create (const char *name, size_t size, size_t align, if (flags & SLAB_RED_ZONE || flags & SLAB_STORE_USER) ralign = BYTES_PER_WORD; - /* 2) arch mandated alignment: disables debug if necessary */ + /* 2) arch mandated alignment */ if (ralign < ARCH_SLAB_MINALIGN) { ralign = ARCH_SLAB_MINALIGN; - if (ralign > BYTES_PER_WORD) - flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER); } - /* 3) caller mandated alignment: disables debug if necessary */ + /* 3) caller mandated alignment */ if (ralign < align) { ralign = align; - if (ralign > BYTES_PER_WORD) - flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER); } + /* disable debug if necessary */ + if (ralign > BYTES_PER_WORD) + flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER); /* * 4) Store it. */ @@ -3063,6 +3062,12 @@ static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep, cachep->ctor(objp, cachep, ctor_flags); } +#if ARCH_SLAB_MINALIGN + if ((u32)objp & (ARCH_SLAB_MINALIGN-1)) { + printk(KERN_ERR "0x%p: not aligned to ARCH_SLAB_MINALIGN=%d\n", + objp, ARCH_SLAB_MINALIGN); + } +#endif return objp; } #else