aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
authorAndrew Shewmaker <agshew@gmail.com>2013-04-29 18:08:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 18:54:36 -0400
commit4eeab4f5580d11bffedc697684b91b0bca0d5009 (patch)
tree4e9a0c010d34e786df52225039a17aa38e9adf17 /kernel/sysctl.c
parentc9b1d0981fcce3d9976d7b7a56e4e0503bc610dd (diff)
mm: replace hardcoded 3% with admin_reserve_pages knob
Add an admin_reserve_kbytes knob to allow admins to change the hardcoded memory reserve to something other than 3%, which may be multiple gigabytes on large memory systems. Only about 8MB is necessary to enable recovery in the default mode, and only a few hundred MB are required even when overcommit is disabled. This affects OVERCOMMIT_GUESS and OVERCOMMIT_NEVER. admin_reserve_kbytes is initialized to min(3% free pages, 8MB) I arrived at 8MB by summing the RSS of sshd or login, bash, and top. Please see first patch in this series for full background, motivation, testing, and full changelog. [akpm@linux-foundation.org: coding-style fixes] [akpm@linux-foundation.org: make init_admin_reserve() static] Signed-off-by: Andrew Shewmaker <agshew@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 6daabb72bdb5..9edcf456e0fc 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1436,6 +1436,13 @@ static struct ctl_table vm_table[] = {
1436 .mode = 0644, 1436 .mode = 0644,
1437 .proc_handler = proc_doulongvec_minmax, 1437 .proc_handler = proc_doulongvec_minmax,
1438 }, 1438 },
1439 {
1440 .procname = "admin_reserve_kbytes",
1441 .data = &sysctl_admin_reserve_kbytes,
1442 .maxlen = sizeof(sysctl_admin_reserve_kbytes),
1443 .mode = 0644,
1444 .proc_handler = proc_doulongvec_minmax,
1445 },
1439 { } 1446 { }
1440}; 1447};
1441 1448