Kyle McMartin a7e4f1c
From owner-linux-mm@kvack.org Wed May 11 11:35:30 2011
Kyle McMartin a7e4f1c
From: Mel Gorman <mgorman@suse.de>
Kyle McMartin a7e4f1c
To: Andrew Morton <akpm@linux-foundation.org>
Kyle McMartin a7e4f1c
Subject: [PATCH 3/3] mm: slub: Default slub_max_order to 0
Kyle McMartin a7e4f1c
Date: Wed, 11 May 2011 16:29:33 +0100
Kyle McMartin a7e4f1c
Message-Id: <1305127773-10570-4-git-send-email-mgorman@suse.de>
Kyle McMartin a7e4f1c
Kyle McMartin a7e4f1c
To avoid locking and per-cpu overhead, SLUB optimisically uses
Kyle McMartin a7e4f1c
high-order allocations up to order-3 by default and falls back to
Kyle McMartin a7e4f1c
lower allocations if they fail. While care is taken that the caller
Kyle McMartin a7e4f1c
and kswapd take no unusual steps in response to this, there are
Kyle McMartin a7e4f1c
further consequences like shrinkers who have to free more objects to
Kyle McMartin a7e4f1c
release any memory. There is anecdotal evidence that significant time
Kyle McMartin a7e4f1c
is being spent looping in shrinkers with insufficient progress being
Kyle McMartin a7e4f1c
made (https://lkml.org/lkml/2011/4/28/361) and keeping kswapd awake.
Kyle McMartin a7e4f1c
Kyle McMartin a7e4f1c
SLUB is now the default allocator and some bug reports have been
Kyle McMartin a7e4f1c
pinned down to SLUB using high orders during operations like
Kyle McMartin a7e4f1c
copying large amounts of data. SLUBs use of high-orders benefits
Kyle McMartin a7e4f1c
applications that are sized to memory appropriately but this does not
Kyle McMartin a7e4f1c
necessarily apply to large file servers or desktops.  This patch
Kyle McMartin a7e4f1c
causes SLUB to use order-0 pages like SLAB does by default.
Kyle McMartin a7e4f1c
There is further evidence that this keeps kswapd's usage lower
Kyle McMartin a7e4f1c
(https://lkml.org/lkml/2011/5/10/383).
Kyle McMartin a7e4f1c
Kyle McMartin a7e4f1c
Signed-off-by: Mel Gorman <mgorman@suse.de>
Kyle McMartin a7e4f1c
---
Kyle McMartin a7e4f1c
 Documentation/vm/slub.txt |    2 +-
Kyle McMartin a7e4f1c
 mm/slub.c                 |    2 +-
Kyle McMartin a7e4f1c
 2 files changed, 2 insertions(+), 2 deletions(-)
Kyle McMartin a7e4f1c
Kyle McMartin a7e4f1c
diff --git a/Documentation/vm/slub.txt b/Documentation/vm/slub.txt
Kyle McMartin a7e4f1c
index 07375e7..778e9fa 100644
Kyle McMartin a7e4f1c
--- a/Documentation/vm/slub.txt
Kyle McMartin a7e4f1c
+++ b/Documentation/vm/slub.txt
Kyle McMartin a7e4f1c
@@ -117,7 +117,7 @@ can be influenced by kernel parameters:
Kyle McMartin a7e4f1c
 
Kyle McMartin a7e4f1c
 slub_min_objects=x		(default 4)
Kyle McMartin a7e4f1c
 slub_min_order=x		(default 0)
Kyle McMartin a7e4f1c
-slub_max_order=x		(default 1)
Kyle McMartin a7e4f1c
+slub_max_order=x		(default 0)
Kyle McMartin a7e4f1c
 
Kyle McMartin a7e4f1c
 slub_min_objects allows to specify how many objects must at least fit
Kyle McMartin a7e4f1c
 into one slab in order for the allocation order to be acceptable.
Kyle McMartin a7e4f1c
diff --git a/mm/slub.c b/mm/slub.c
Kyle McMartin a7e4f1c
index 1071723..23a4789 100644
Kyle McMartin a7e4f1c
--- a/mm/slub.c
Kyle McMartin a7e4f1c
+++ b/mm/slub.c
Kyle McMartin a7e4f1c
@@ -2198,7 +2198,7 @@ EXPORT_SYMBOL(kmem_cache_free);
Kyle McMartin a7e4f1c
  * take the list_lock.
Kyle McMartin a7e4f1c
  */
Kyle McMartin a7e4f1c
 static int slub_min_order;
Kyle McMartin a7e4f1c
-static int slub_max_order = PAGE_ALLOC_COSTLY_ORDER;
Kyle McMartin a7e4f1c
+static int slub_max_order;
Kyle McMartin a7e4f1c
 static int slub_min_objects;
Kyle McMartin a7e4f1c
 
Kyle McMartin a7e4f1c
 /*
Kyle McMartin a7e4f1c
-- 
Kyle McMartin a7e4f1c
1.7.3.4
Kyle McMartin a7e4f1c
Kyle McMartin a7e4f1c
--
Kyle McMartin a7e4f1c
To unsubscribe, send a message with 'unsubscribe linux-mm' in
Kyle McMartin a7e4f1c
the body to majordomo@kvack.org.  For more info on Linux MM,
Kyle McMartin a7e4f1c
see: http://www.linux-mm.org/ .
Kyle McMartin a7e4f1c
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Kyle McMartin a7e4f1c
Don't email:  email@kvack.org 
Kyle McMartin a7e4f1c