From: Christoph Lameter <clameter@sgi.com>
To: akpm@osdl.org
Cc: linux-mm@kvack.org, mpm@selenic.com,
linux-kernel@vger.kernel.org,
Christoph Lameter <clameter@sgi.com>
Subject: [SLUB 3/3] Configurable slub_max_order
Date: Sat, 10 Mar 2007 18:10:26 -0800 (PST) [thread overview]
Message-ID: <20070311021026.19963.48123.sendpatchset@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20070311021009.19963.11893.sendpatchset@schroedinger.engr.sgi.com>
Add slub_max_order
Avoid slabs getting to large. Do no longer enforce slub_min_objects
if the slab gets bigger than slub_max_order.
I am not sure if we really want this. Maybe we should make the
selection of the base page size depending on page allocator
defrag behavior? I.e. try to restrict allocations to order 0 and order 2
so that can limit fragmentation?
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Index: linux-2.6.21-rc3/mm/slub.c
===================================================================
--- linux-2.6.21-rc3.orig/mm/slub.c 2007-03-10 13:14:06.000000000 -0800
+++ linux-2.6.21-rc3/mm/slub.c 2007-03-10 13:14:11.000000000 -0800
@@ -1211,6 +1211,7 @@ static __always_inline struct page *get_
* take the list_lock.
*/
static int slub_min_order = 0;
+static int slub_max_order = 4;
/*
* Minimum number of objects per slab. This is necessary in order to
@@ -1249,7 +1250,11 @@ static int calculate_order(int size)
order < MAX_ORDER; order++) {
unsigned long slab_size = PAGE_SIZE << order;
- if (slab_size < slub_min_objects * size)
+ if (slub_max_order > order &&
+ slab_size < slub_min_objects * size)
+ continue;
+
+ if (slab_size < size)
continue;
rem = slab_size % size;
@@ -1637,6 +1642,15 @@ static int __init setup_slub_min_order(c
__setup("slub_min_order=", setup_slub_min_order);
+static int __init setup_slub_max_order(char *str)
+{
+ get_option (&str, &slub_max_order);
+
+ return 1;
+}
+
+__setup("slub_max_order=", setup_slub_max_order);
+
static int __init setup_slub_min_objects(char *str)
{
get_option (&str, &slub_min_objects);
--
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:[~2007-03-11 2:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-11 2:10 [SLUB 0/3] SLUB: The unqueued slab allocator V5 Christoph Lameter
2007-03-11 2:10 ` [SLUB 1/3] SLUB core Christoph Lameter
2007-03-11 2:10 ` [SLUB 2/3] Enable poisoning for RCU and constructors Christoph Lameter
2007-03-11 2:10 ` Christoph Lameter [this message]
2007-03-11 6:49 ` [SLUB 0/3] SLUB: The unqueued slab allocator V5 Andrew Morton
2007-03-11 7:04 ` 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=20070311021026.19963.48123.sendpatchset@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mpm@selenic.com \
/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