[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.58.0607261251530.17557@sbz-30.cs.Helsinki.FI>
Date:	Wed, 26 Jul 2006 12:55:48 +0300 (EEST)
From:	Pekka J Enberg <penberg@...Helsinki.FI>
To:	Heiko Carstens <heiko.carstens@...ibm.com>
cc:	Christoph Lameter <clameter@....com>,
	Andrew Morton <akpm@...l.org>, linux-kernel@...r.kernel.org
Subject: Re: [patch] slab: always follow arch requested alignments
Hi Heiko,
On Wed, 26 Jul 2006, Heiko Carstens wrote:
> Since I didn't get an ACK or NACK, I split this patch into two very small
> ones and repost them. Hopefully with a better description than the first
> time.
I don't see ARCH_SLAB_MINALIGN defined for s390, what's up with that? I 
agree that we should always respect ARCH_SLAB_MINALIGN no matter what. 
Does the included patch fix that for you?
				Pekka
[PATCH] slab: respect mandated minimum architecture alignment
The slab debugging code for SLAB_RED_ZONE and SLAB_STORE_USER require 
BYTES_PER_WORD alignment for the caches. However, for some architectures, 
the mandated minimum alignment might be bigger than that, so disable 
debugging for those cases instead of crashing the machine.
Signed-off-by: Pekka Enberg <penberg@...helsinki.fi>
---
diff --git a/mm/slab.c b/mm/slab.c
index 0f20843..0346311 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2123,6 +2123,13 @@ #endif
 #if DEBUG
 	cachep->obj_size = size;
 
+	/*
+	 * Debugging requires BYTES_PER_WORD alignment but we must always
+	 * respect ARCH_SLAB_MINALIGN so disable debugging if necessary.
+	 */
+	if (ARCH_SLAB_MINALIGN > BYTES_PER_WORD)
+		flags &= ~(SLAB_RED_ZONE | SLAB_STORE_USER);
+
 	if (flags & SLAB_RED_ZONE) {
 		/* redzoning only works with word aligned caches */
 		align = BYTES_PER_WORD;
-
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
 
