]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/slub_def.h
slub: Do not use 192 byte sized cache if minimum alignment is 128 byte
[linux-2.6-omap-h63xx.git] / include / linux / slub_def.h
index 4131e5fbd18be5239820273fbe3798362e54d6de..cef6f8fddd7dae42d667297c197f43cc8fdcc142 100644 (file)
@@ -29,6 +29,7 @@ enum stat_item {
        DEACTIVATE_TO_HEAD,     /* Cpu slab was moved to the head of partials */
        DEACTIVATE_TO_TAIL,     /* Cpu slab was moved to the tail of partials */
        DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */
+       ORDER_FALLBACK,         /* Number of times fallback was necessary */
        NR_SLUB_STAT_ITEMS };
 
 struct kmem_cache_cpu {
@@ -48,6 +49,7 @@ struct kmem_cache_node {
        struct list_head partial;
 #ifdef CONFIG_SLUB_DEBUG
        atomic_long_t nr_slabs;
+       atomic_long_t total_objects;
        struct list_head full;
 #endif
 };
@@ -79,6 +81,8 @@ struct kmem_cache {
        struct kmem_cache_node local_node;
 
        /* Allocation and freeing of slabs */
+       struct kmem_cache_order_objects max;
+       struct kmem_cache_order_objects min;
        gfp_t allocflags;       /* gfp flags to use on each alloc */
        int refcount;           /* Refcount for slab cache destroy */
        void (*ctor)(struct kmem_cache *, void *);
@@ -133,10 +137,12 @@ static __always_inline int kmalloc_index(size_t size)
        if (size <= KMALLOC_MIN_SIZE)
                return KMALLOC_SHIFT_LOW;
 
+#if KMALLOC_MIN_SIZE <= 64
        if (size > 64 && size <= 96)
                return 1;
        if (size > 128 && size <= 192)
                return 2;
+#endif
        if (size <=          8) return 3;
        if (size <=         16) return 4;
        if (size <=         32) return 5;