Thread (73 messages) 73 messages, 8 authors, 2007-06-28

Re: [patch 10/26] SLUB: Faster more efficient slab determination for __kmalloc.

From: Christoph Lameter <hidden>
Date: 2007-06-19 22:38:17
Also in: lkml

On Tue, 19 Jun 2007, Andrew Morton wrote:
On Tue, 19 Jun 2007 15:22:36 -0700 (PDT)
Christoph Lameter [off-list ref] wrote:
quoted
On Tue, 19 Jun 2007, Andrew Morton wrote:
quoted
On Mon, 18 Jun 2007 02:58:48 -0700
clameter@sgi.com wrote:
quoted
+	BUG_ON(KMALLOC_MIN_SIZE > 256 ||
+		(KMALLOC_MIN_SIZE & (KMALLOC_MIN_SIZE - 1)));
BUILD_BUG_ON?
Does not matter. That code is __init.
Finding out at compile time is better.
Ok and BUILD_BUG_ON really works? Had some bad experiences with it.

Signed-off-by: Christoph Lameter <redacted>

Index: linux-2.6.22-rc4-mm2/mm/slub.c
===================================================================
--- linux-2.6.22-rc4-mm2.orig/mm/slub.c	2007-06-19 15:36:57.000000000 -0700
+++ linux-2.6.22-rc4-mm2/mm/slub.c	2007-06-19 15:37:05.000000000 -0700
@@ -3079,7 +3079,7 @@ void __init kmem_cache_init(void)
 	 * Make sure that nothing crazy happens if someone starts tinkering
 	 * around with ARCH_KMALLOC_MINALIGN
 	 */
-	BUG_ON(KMALLOC_MIN_SIZE > 256 ||
+	BUILD_BUG_ON(KMALLOC_MIN_SIZE > 256 ||
 		(KMALLOC_MIN_SIZE & (KMALLOC_MIN_SIZE - 1)));
 
 	for (i = 8; i < KMALLOC_MIN_SIZE;i++)
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help