From 900092112a5c9cd639c97c331982bcf105c6bc60 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 16. Set the max order to default to PAGE_ALLOC_ORDER_COSTLY (32k) 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-03-16 19:57:46.919835086 -0700 +++ linux-2.6/mm/slub.c 2008-03-16 19:57:54.955976805 -0700 @@ -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 PAGE_ALLOC_COSTLY_ORDER +#define DEFAULT_MIN_OBJECTS (2 << PAGE_ALLOC_COSTLY_ORDER) /* * Mininum number of partial slabs. These will be left on the partial @@ -1833,8 +1817,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)