From: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>, Mel Gorman <mel@csn.ul.ie>,
Matt Mackall <mpm@selenic.com>,
linux-mm@kvack.org
Subject: Re: [patch 7/9] slub: Adjust order boundaries and minimum objects per slab.
Date: Thu, 20 Mar 2008 14:44:43 +0800 [thread overview]
Message-ID: <1205995483.14496.59.camel@ymzhang> (raw)
In-Reply-To: <20080317230529.474353536@sgi.com>
On Mon, 2008-03-17 at 16:05 -0700, Christoph Lameter wrote:
> plain text document attachment
> (0007-slub-Adjust-order-boundaries-and-minimum-objects-pe.patch)
> Since there is now no worry anymore about higher order allocs (hopefully).
> 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.
>
> The mininum objects per slab is calculated based on the number of processors
> that may come online.
>
> Processors min_objects
> ---------------------------
> 1 4
> 2 8
> 4 12
> 8 16
> 16 20
> 32 24
> 64 28
> 1024 44
> 4096 52
All min_objects's real values are 4 more than above values, as fls(16)
is equal to 5. So on 16-core tigerton, min_objects=24 which is between 16 and 32.
I applied the patches to 2.6.26-rc6 and tested it on 16-core tigerton and 8-core
stoakley. The result is between the ones of min_objects=16 and min_objects=32 on tigerton.
On stoakley, the result distance is even smaller. I'm ok with the result.
Thanks,
yanmin
>
> V1->V2
> - Add logic to compute min_objects based on processor count.
>
> Signed-off-by: Christoph Lameter <clameter@sgi.com>
> ---
> mm/slub.c | 29 +++++++----------------------
> 1 file changed, 7 insertions(+), 22 deletions(-)
>
> Index: linux-2.6/mm/slub.c
> ===================================================================
> --- linux-2.6.orig/mm/slub.c 2008-03-17 15:33:42.118699647 -0700
> +++ linux-2.6/mm/slub.c 2008-03-17 15:49:57.459504642 -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 <clameter@sgi.com>
> + * (C) 2007, 2008 SGI, Christoph Lameter <clameter@sgi.com>
> */
>
> #include <linux/mm.h>
> @@ -149,24 +149,7 @@ 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
>
> /*
> * Mininum number of partial slabs. These will be left on the partial
> @@ -1768,7 +1751,7 @@ static struct page *get_object_page(cons
> */
> static int slub_min_order;
> static int slub_max_order = DEFAULT_MAX_ORDER;
> -static int slub_min_objects = DEFAULT_MIN_OBJECTS;
> +static int slub_min_objects = -1;
>
> /*
> * Merge control. If this is set then no merging of slab caches will occur.
> @@ -1845,9 +1828,11 @@ static inline int calculate_order(int si
> * we reduce the minimum objects required in a slab.
> */
> min_objects = slub_min_objects;
> + if (min_objects <= 0)
> + min_objects = 4 * (fls(nr_cpu_ids) + 1);
> 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)
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2008-03-20 6:44 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080317230516.078358225@sgi.com>
[not found] ` <20080317230528.279983034@sgi.com>
2008-03-19 9:09 ` [patch 2/9] Store max number of objects in the page struct Zhang, Yanmin
2008-03-19 17:49 ` Christoph Lameter
2008-03-20 3:32 ` Zhang, Yanmin
2008-03-20 21:05 ` Christoph Lameter
2008-03-21 22:24 ` Andrew Morton
2008-03-22 3:27 ` Ben Pfaff
2008-03-24 1:22 ` [PATCH] Add definitions of USHORT_MAX and others Zhang, Yanmin
[not found] ` <20080317230528.939792410@sgi.com>
2008-03-20 5:10 ` [patch 5/9] slub: Fallback to minimal order during slab page allocation Zhang, Yanmin
2008-03-20 18:29 ` Christoph Lameter
2008-03-21 0:52 ` Zhang, Yanmin
2008-03-21 3:35 ` Christoph Lameter
2008-03-21 5:14 ` Zhang, Yanmin
2008-03-21 6:07 ` Christoph Lameter
2008-03-21 8:23 ` Zhang, Yanmin
[not found] ` <20080317230529.701336582@sgi.com>
2008-03-20 5:53 ` [patch 8/9] slub: Make the order configurable for each slab cache Zhang, Yanmin
2008-03-20 18:31 ` Christoph Lameter
2008-03-20 23:57 ` Christoph Lameter
[not found] ` <20080317230529.474353536@sgi.com>
2008-03-18 18:54 ` [patch 7/9] slub: Adjust order boundaries and minimum objects per slab Pekka Enberg
2008-03-18 19:00 ` Christoph Lameter
2008-03-19 1:04 ` Zhang, Yanmin
2008-03-19 15:20 ` Pekka Enberg
2008-03-20 6:44 ` Zhang, Yanmin [this message]
2008-03-20 18:32 ` Christoph Lameter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1205995483.14496.59.camel@ymzhang \
--to=yanmin_zhang@linux.intel.com \
--cc=clameter@sgi.com \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
--cc=mpm@selenic.com \
--cc=penberg@cs.helsinki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).