]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/slub_def.h
SLUB: CONFIG_LARGE_ALLOCS must consider MAX_ORDER limit
[linux-2.6-omap-h63xx.git] / include / linux / slub_def.h
index f8e0c86c48a93a00b445171874b1b134e06a60e9..fd6627e2d11507bbc376be736cd9625098eb67df 100644 (file)
@@ -16,6 +16,7 @@ struct kmem_cache_node {
        unsigned long nr_partial;
        atomic_long_t nr_slabs;
        struct list_head partial;
+       struct list_head full;
 };
 
 /*
@@ -59,7 +60,8 @@ struct kmem_cache {
 #define KMALLOC_SHIFT_LOW 3
 
 #ifdef CONFIG_LARGE_ALLOCS
-#define KMALLOC_SHIFT_HIGH 25
+#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT) =< 25 ? \
+                               (MAX_ORDER + PAGE_SHIFT - 1) : 25)
 #else
 #if !defined(CONFIG_MMU) || NR_CPUS > 512 || MAX_NUMNODES > 256
 #define KMALLOC_SHIFT_HIGH 20
@@ -86,6 +88,9 @@ static inline int kmalloc_index(int size)
         */
        WARN_ON_ONCE(size == 0);
 
+       if (size >= (1 << KMALLOC_SHIFT_HIGH))
+               return -1;
+
        if (size > 64 && size <= 96)
                return 1;
        if (size > 128 && size <= 192)