From e4efb612fd2178697b7341c4f07a067a5328735e Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Fri, 15 Feb 2008 15:22:22 -0800 Subject: [PATCH] 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 4 (64k) and require slub to use a higher order if a certain object density cannot be reached. 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-28 18:46:02.549632237 -0800 +++ linux-2.6/mm/slub.c 2008-02-28 18:46:07.341659725 -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 @@ -149,24 +149,8 @@ static inline void ClearSlabDebug(struct /* Enable to test recovery from slab corruption on boot */ #undef SLUB_RESILIENCY_TEST -#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 4 +#define DEFAULT_MIN_OBJECTS 60 /* * Mininum number of partial slabs. These will be left on the partial @@ -1838,8 +1822,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)