public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: akpm@osdl.org
Cc: Marcelo Tosatti <marcelo@kvack.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	Christoph Lameter <clameter@sgi.com>,
	mpm@selenic.com, Manfred Spraul <manfred@colorfullife.com>
Subject: [SLUB 3/3] Guarantee minimum number of objects in a slab
Date: Tue,  6 Mar 2007 18:35:21 -0800 (PST)	[thread overview]
Message-ID: <20070307023521.19658.80916.sendpatchset@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20070307023502.19658.39217.sendpatchset@schroedinger.engr.sgi.com>

Guarantee a mininum number of objects per slab

The number of objects per slab is important for SLUB because it determines
the number of allocations that can be performed without having to consult
per node slab lists. Add another boot option "min_objects=xx" that
allows the configuration of the objects per slab. This is similar
to SLABS queue configurations.

Set the default of objects to 4. This will increase the page order for
certain slab objects.

Signed-off-by: Christoph Lameter <clameter@sgi.com>

Index: linux-2.6.21-rc2-mm1/mm/slub.c
===================================================================
--- linux-2.6.21-rc2-mm1.orig/mm/slub.c	2007-03-06 17:57:11.000000000 -0800
+++ linux-2.6.21-rc2-mm1/mm/slub.c	2007-03-06 17:57:15.000000000 -0800
@@ -1201,6 +1201,12 @@ static __always_inline struct page *get_
 static int slub_min_order = 0;
 
 /*
+ * Minumum number of objects per slab. This is necessary in order to
+ * reduce locking overhead. Similar to the queue size in SLAB.
+ */
+static int slub_min_objects = 4;
+
+/*
  * Merge control. If this is set then no merging of slab caches will occur.
  */
 static int slub_nomerge = 0;
@@ -1232,7 +1238,7 @@ static int calculate_order(int size)
 			order < MAX_ORDER; order++) {
 		unsigned long slab_size = PAGE_SIZE << order;
 
-		if (slab_size < size)
+		if (slab_size < slub_min_objects * size)
 			continue;
 
 		rem = slab_size % size;
@@ -1624,6 +1630,15 @@ static int __init setup_slub_min_order(c
 
 __setup("slub_min_order=", setup_slub_min_order);
 
+static int __init setup_slub_min_objects(char *str)
+{
+	get_option (&str, &slub_min_objects);
+
+	return 1;
+}
+
+__setup("slub_min_objects=", setup_slub_min_objects);
+
 static int __init setup_slub_nomerge(char *str)
 {
 	slub_nomerge = 1;

--
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>

  parent reply	other threads:[~2007-03-07  2:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-07  2:35 [SLUB 0/3] SLUB: The unqueued slab allocator V4 Christoph Lameter
2007-03-07  2:35 ` [SLUB 1/3] SLUB core Christoph Lameter
2007-03-07  2:35 ` [SLUB 2/3] Large kmalloc pass through. Removal of large general slabs Christoph Lameter
2007-03-07  2:40   ` Matt Mackall
2007-03-07  3:22     ` Christoph Lameter
2007-03-07  9:01   ` Peter Zijlstra
2007-03-07 15:34     ` Christoph Lameter
2007-03-07 18:03       ` Matt Mackall
2007-03-07 18:23         ` Christoph Lameter
2007-03-07  2:35 ` Christoph Lameter [this message]
2007-03-08 10:54 ` [SLUB 0/3] SLUB: The unqueued slab allocator V4 Mel Gorman
2007-03-08 16:48   ` Christoph Lameter
2007-03-08 17:40     ` Mel Gorman
2007-03-08 18:16       ` Christoph Lameter
2007-03-09 13:55         ` Mel Gorman
2007-03-08 21:54       ` Christoph Lameter
2007-03-09 14:00         ` Mel Gorman
2007-03-09 16:40           ` Christoph Lameter
2007-03-09 15:06         ` Mel Gorman
2007-03-09 17:21           ` Christoph Lameter
2007-03-08 17:46   ` 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=20070307023521.19658.80916.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=manfred@colorfullife.com \
    --cc=marcelo@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