On 06/14/2012 02:16 PM, Pekka Enberg wrote:
On Wed, Jun 13, 2012 at 6:25 PM, Christoph Lameter<cl@xxxxxxxxx> wrote:
Move kmem_cache memory allocation and the checks for success out of the
slab allocators into the common code.
Signed-off-by: Christoph Lameter<cl@xxxxxxxxx>
This patch seems to cause hard lockup on my laptop on boot.
P.S. While bisecting this, I also saw some other oopses so I think
this series needs some more testing before we can put it in
linux-next...
Hi Pekka
Could you please test the following patch ?
This made Cristoph's series a lot more stable for me, it will at least
allow us to know if this is the issue, or if you're seeing something else.
>From c6224ec536fd87fb3705a531aa2dc578d5bfdec9 Mon Sep 17 00:00:00 2001
From: Glauber Costa <glommer@xxxxxxxxxxxxx>
Date: Wed, 13 Jun 2012 14:02:21 +0400
Subject: [PATCH] slab: fix obj size calculation
Where we previously read:
- cache_cache.object_size = cache_cache.size;
- cache_cache.size = ALIGN(cache_cache.size,
After Cristoph's series, we now read:
+ kmem_cache->size = kmem_cache->size;
+ kmem_cache->size = ALIGN(kmem_cache->size,
Note that the first line should really say object_size, rather than size.
This is causing me some quite bizarre bugs, that occur mostly when
kmem_zalloc and other allocations like that are used. Because object_size
can and will be wrong, people relying on zeroed data structures will not
always have their assumptions held.
Signed-off-by: Glauber Costa <glommer@xxxxxxxxxxxxx>
CC: Christoph Lameter <cl@xxxxxxxxx>
CC: Pekka Enberg <penberg@xxxxxxxxxx>
---
mm/slab.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/slab.c b/mm/slab.c
index 23267bb..2476ad4 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1520,7 +1520,7 @@ void __init kmem_cache_init(void)
*/
kmem_cache->size = offsetof(struct kmem_cache, array[nr_cpu_ids]) +
nr_node_ids * sizeof(struct kmem_list3 *);
- kmem_cache->size = kmem_cache->size;
+ kmem_cache->object_size = kmem_cache->size;
kmem_cache->size = ALIGN(kmem_cache->size,
cache_line_size());
kmem_cache->reciprocal_buffer_size =
--
1.7.10.2