From: Christoph Lameter Subject: slub: Adjust order boundaries and minimum objects per slab. Since there is now no worry anymore about higher order allocs (hopefully) increase the minimum of objects per slab to 60 so that slub can reach a similar fastpath/slowpath ratio as slab. Set the max order to default to 6 (256k). Signed-off-by: Christoph Lameter --- mm/slub.c | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) Index: linux-2.6/mm/slub.c =================================================================== --- linux-2.6.orig/mm/slub.c 2008-02-15 14:16:15.383080863 -0800 +++ linux-2.6/mm/slub.c 2008-02-15 14:53:39.075069061 -0800 @@ -5,7 +5,7 @@ * The allocator synchronizes using per slab locks and only * uses a centralized lock to manage a pool of partial slabs. * - * (C) 2007 SGI, Christoph Lameter + * (C) 2007, 2008 SGI, Christoph Lameter */ #include @@ -156,24 +156,8 @@ static inline void ClearSlabDebug(struct #define SLUB_FASTPATH #endif -#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 - -/* - * Large page machines are customarily able to handle larger - * page orders. - */ -#define DEFAULT_MAX_ORDER 2 -#define DEFAULT_MIN_OBJECTS 8 - -#endif +#define DEFAULT_MAX_ORDER 6 +#define DEFAULT_MIN_OBJECTS 60 /* * Mininum number of partial slabs. These will be left on the partial @@ -1966,8 +1950,8 @@ static inline int calculate_order(int si */ min_objects = slub_min_objects; while (min_objects > 1) { - fraction = 8; - while (fraction >= 4) { + fraction = 16; + while (fraction >= 8) { order = slab_order(size, min_objects, slub_max_order, fraction); if (order <= slub_max_order)