[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0000013e6705da99-094923c6-e239-43d2-8f0c-5e661656a27c-000000@email.amazonses.com>
Date: Thu, 2 May 2013 20:53:57 +0000
From: Christoph Lameter <cl@...ux.com>
To: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
cc: glommer@...allels.com, penberg@...nel.org,
linux-kernel@...r.kernel.org
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@...ux.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists