[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0705211121570.26794@schroedinger.engr.sgi.com>
Date:	Mon, 21 May 2007 11:25:39 -0700 (PDT)
From:	Christoph Lameter <clameter@....com>
To:	Hugh Dickins <hugh@...itas.com>
cc:	Srihari Vijayaraghavan <sriharivijayaraghavan@...oo.com.au>,
	Oliver Xymoron <oxymoron@...te.org>,
	Jens Axboe <jens.axboe@...cle.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PROBLEM] 2.6.22-rc2 panics on x86-64 with slub
On Mon, 21 May 2007, Hugh Dickins wrote:
> Yes, sounded the same to me too: I couldn't reproduce it or see anything
> wrong in the code back then.  But Srihari's info about CONFIG_DEBUG_SLUB
> off has helped a lot: I was then able to reproduce it on my x86_64, and
> after a lot of staring at the code, the problem became obvious...
Right. The #ifdef CONFIG_SLUB_DEBUG is at the wrong location. The best fix
is to moving the #ifdef otherwise the size is still wrong for the 
ctor case.
SLUB Debug: Fix object size calculation
The object size calculation is wrong if !CONFIG_SLUB_DEBUG because
the #ifdef CONFIG_SLUB_DEBUG is now switching off the size adjustments
for DESTROY_BY_RCU and ctor.
Signed-off-by: Christoph Lameter <clameter@....com>
---
 mm/slub.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Index: slub/mm/slub.c
===================================================================
--- slub.orig/mm/slub.c	2007-05-21 11:21:36.000000000 -0700
+++ slub/mm/slub.c	2007-05-21 11:21:49.000000000 -0700
@@ -1943,7 +1943,6 @@ static int calculate_sizes(struct kmem_c
 	 */
 	s->inuse = size;
 
-#ifdef CONFIG_SLUB_DEBUG
 	if (((flags & (SLAB_DESTROY_BY_RCU | SLAB_POISON)) ||
 		s->ctor)) {
 		/*
@@ -1958,6 +1957,7 @@ static int calculate_sizes(struct kmem_c
 		size += sizeof(void *);
 	}
 
+#ifdef CONFIG_SLUB_DEBUG
 	if (flags & SLAB_STORE_USER)
 		/*
 		 * Need to store information about allocs and frees after
-
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
 
