summaryrefslogtreecommitdiff
path: root/mm/util.c
diff options
context:
space:
mode:
authorSebastian Frias <sf84@laposte.net>2016-05-11 09:51:49 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2016-05-13 13:24:40 +1000
commit6002b567dec503be8e4f4185595c4fe557655989 (patch)
tree08894729ea8730a1337c2d62c8b1b2c731d950b0 /mm/util.c
parent3a82bd62e3e73107c5c74624b7dc2cd9e738e5e6 (diff)
mm: add config option to select the initial overcommit mode
Currently the initial value of the overcommit mode is OVERCOMMIT_GUESS. However, on embedded systems it is usually better to disable overcommit to avoid waking up the OOM-killer and its well known undesirable side-effects. This config option allows to setup the initial overcommit mode to any of the 3 available values, OVERCOMMIT_GUESS (which remains as default), OVERCOMMIT_ALWAYS and OVERCOMMIT_NEVER. The overcommit mode can still be changed thru sysctl after the system boots up. This config option depends on CONFIG_EXPERT. This patch does not introduces functional changes. Link: http://lkml.kernel.org/r/5731CC6E.3080807@laposte.net Signed-off-by: Sebastian Frias <sf84@laposte.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/util.c')
-rw-r--r--mm/util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/util.c b/mm/util.c
index 8a1b3a1fb595..6682eb92ccca 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -417,7 +417,13 @@ int __page_mapcount(struct page *page)
}
EXPORT_SYMBOL_GPL(__page_mapcount);
+#if defined(CONFIG_OVERCOMMIT_NEVER)
+int sysctl_overcommit_memory __read_mostly = OVERCOMMIT_NEVER;
+#elif defined(CONFIG_OVERCOMMIT_ALWAYS)
+int sysctl_overcommit_memory __read_mostly = OVERCOMMIT_ALWAYS;
+#else
int sysctl_overcommit_memory __read_mostly = OVERCOMMIT_GUESS;
+#endif
int sysctl_overcommit_ratio __read_mostly = 50;
unsigned long sysctl_overcommit_kbytes __read_mostly;
int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT;