On Thu, 10 May 2007, David Miller wrote:

> What SLAB allows you to do is define LARGE_ALLOCS but not necessarily
> set MAX_ORDER large enough for the largest kmalloc SLAB.  SLAB would
> ignore the kmalloc cache creation failures for these largest ones that
> are over MAX_ORDER.

Hmmm... How about limiting KMALLOC_SHIFT_HIGH to max order?

---
 include/linux/slub_def.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: slub/include/linux/slub_def.h
===================================================================
--- slub.orig/include/linux/slub_def.h  2007-05-10 15:19:39.000000000 -0700
+++ slub/include/linux/slub_def.h       2007-05-10 15:20:39.000000000 -0700
@@ -59,7 +59,7 @@ struct kmem_cache {
 #define KMALLOC_SHIFT_LOW 3
 
 #ifdef CONFIG_LARGE_ALLOCS
-#define KMALLOC_SHIFT_HIGH 25
+#define KMALLOC_SHIFT_HIGH (min(25, MAX_ORDER + PAGE_SHIFT))
 #else
 #if !defined(CONFIG_MMU) || NR_CPUS > 512 || MAX_NUMNODES > 256
 #define KMALLOC_SHIFT_HIGH 20
-
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to