--- mm/slub.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) Index: linux-2.6/mm/slub.c =================================================================== --- linux-2.6.orig/mm/slub.c 2007-09-18 10:58:11.000000000 -0700 +++ linux-2.6/mm/slub.c 2007-09-18 10:58:31.000000000 -0700 @@ -154,14 +154,15 @@ static inline void ClearSlabDebug(struct /* Enable to test recovery from slab corruption on boot */ #undef SLUB_RESILIENCY_TEST +#define VFALLBACK_MAX_ORDER 6 +#define DEFAULT_MIN_OBJECTS 100 + #if PAGE_SHIFT <= 12 /* * Small page size. Make sure that we do not fragment memory */ #define DEFAULT_MAX_ORDER 1 -#define DEFAULT_MIN_OBJECTS 4 - #else /* @@ -169,8 +170,6 @@ static inline void ClearSlabDebug(struct * page orders. */ #define DEFAULT_MAX_ORDER 2 -#define DEFAULT_MIN_OBJECTS 8 - #endif /* @@ -1770,6 +1769,7 @@ static inline int slab_order(int size, i int order; int rem; int min_order = slub_min_order; + int trace = min_objects == 100 && max_order == 6; /* * If we would create too many object per slab then reduce @@ -1780,11 +1780,16 @@ static inline int slab_order(int size, i min_order--; for (order = max(min_order, - fls(min_objects * size - 1) - PAGE_SHIFT); + fls(min_objects * size - 1) + 1 - PAGE_SHIFT); order <= max_order; order++) { unsigned long slab_size = PAGE_SIZE << order; + if (trace && slab_is_available()) + printk(KERN_ERR "slab_order(%d, %d, %d, %d) order=%d slab_size=%ld\n", + size, min_objects, max_order, fract_leftover, order, + slab_size); + if (slab_size < min_objects * size) continue;