[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1421908189-18938-1-git-send-email-chaowang@redhat.com>
Date: Thu, 22 Jan 2015 14:29:49 +0800
From: WANG Chao <chaowang@...hat.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Davidlohr Bueso <dave@...olabs.net>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Michel Lespinasse <walken@...gle.com>,
Rik van Riel <riel@...hat.com>, Mel Gorman <mgorman@...e.de>,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: [PATCH] mm, vmacache: Add kconfig VMACACHE_SHIFT
Add a new kconfig option VMACACHE_SHIFT (as a power of 2) to specify the
number of slots vma cache has for each thread. Range is chosen 0-4 (1-16
slots) to consider both overhead and performance penalty. Default is 2
(4 slots) as it originally is, which provides good enough balance.
Signed-off-by: WANG Chao <chaowang@...hat.com>
---
include/linux/sched.h | 2 +-
mm/Kconfig | 7 +++++++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 8db31ef..56fd96d 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -134,7 +134,7 @@ struct perf_event_context;
struct blk_plug;
struct filename;
-#define VMACACHE_BITS 2
+#define VMACACHE_BITS CONFIG_VMACACHE_SHIFT
#define VMACACHE_SIZE (1U << VMACACHE_BITS)
#define VMACACHE_MASK (VMACACHE_SIZE - 1)
diff --git a/mm/Kconfig b/mm/Kconfig
index 1d1ae6b..7b82a52 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -618,3 +618,10 @@ config MAX_STACK_SIZE_MB
changed to a smaller value in which case that is used.
A sane initial value is 80 MB.
+
+config VMACACHE_SHIFT
+ int "Number of slots in per-thread VMA cache (as a power of 2)"
+ range 0 4
+ default 2
+ help
+ This is the number of slots VMA cache has for each thread.
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists