Messages in this thread Patch in this message | | | Date | Thu, 2 May 2013 20:53:57 +0000 | From | Christoph Lameter <> | Subject | Re: [linux-next-20130422] Bug in SLAB? |
| |
On Wed, 1 May 2013, Tetsuo Handa wrote:
> The culprit location is possibly in SLAB because the kernel boots if built with > CONFIG_DEBUG_SLAB=n || CONFIG_DEBUG_SPINLOCK=n || CONFIG_DEBUG_PAGEALLOC=n.
I have booted such a configuration just fine. Please have a look at the kernel config that I send or send me yours.
Here is a patch that restores the old behavior for SLAB
Subject: slab: Return NULL for oversized allocations
The inline path seems to have changed the SLAB behavior for very large kmalloc allocations. This patch restores the old behavior.
Signed-off-by: Christoph Lameter <cl@linux.com>
Index: linux/include/linux/slab_def.h =================================================================== --- linux.orig/include/linux/slab_def.h 2013-05-02 15:02:45.864728115 -0500 +++ linux/include/linux/slab_def.h 2013-05-02 15:06:14.940474110 -0500 @@ -126,6 +126,9 @@ static __always_inline void *kmalloc(siz if (!size) return ZERO_SIZE_PTR;
+ if (size >= KMALLOC_MAX_SIZE) + return NULL; + i = kmalloc_index(size);
#ifdef CONFIG_ZONE_DMA @@ -172,6 +175,9 @@ static __always_inline void *kmalloc_nod if (!size) return ZERO_SIZE_PTR;
+ if (size > KMALLOC_MAX_SIZE) + return NULL; + i = kmalloc_index(size);
#ifdef CONFIG_ZONE_DMA
| |