From b874a13c9dbd315d075cef183de1effa48c00457 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 files changed, 5 insertions(+), 21 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index dc00a89..20576b1 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -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 page *page) /* 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 @@ -1844,8 +1828,8 @@ static inline int calculate_order(int size) */ 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) -- 1.5.4.1