From: Andrew Morton <akpm@linux-foundation.org>
To: Andrew Shewmaker <agshew@gmail.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
alan@lxorguk.ukuu.org.uk, simon.jeons@gmail.com,
ric.masonn@gmail.com
Subject: Re: [PATCH v8 2/3] mm: replace hardcoded 3% with admin_reserve_pages knob
Date: Mon, 8 Apr 2013 12:39:11 -0700 [thread overview]
Message-ID: <20130408123911.6f1101fd988bcc680eb37c46@linux-foundation.org> (raw)
In-Reply-To: <20130408190510.GB2321@localhost.localdomain>
On Mon, 8 Apr 2013 15:05:10 -0400 Andrew Shewmaker <agshew@gmail.com> wrote:
> 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.
And the only change that v8 made was to revert earlier fixes, so I'll
skip this version as well.
--- a/include/linux/mm.h~mm-replace-hardcoded-3%-with-admin_reserve_pages-knob-v8
+++ a/include/linux/mm.h
@@ -45,7 +45,6 @@ extern int sysctl_legacy_va_layout;
#include <asm/processor.h>
extern unsigned long sysctl_user_reserve_kbytes;
-extern unsigned long sysctl_admin_reserve_kbytes;
#define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))
--- a/kernel/sysctl.c~mm-replace-hardcoded-3%-with-admin_reserve_pages-knob-v8
+++ a/kernel/sysctl.c
@@ -97,6 +97,7 @@
/* External variables not in a header file. */
extern int sysctl_overcommit_memory;
extern int sysctl_overcommit_ratio;
+extern unsigned long sysctl_admin_reserve_kbytes;
extern int max_threads;
extern int suid_dumpable;
#ifdef CONFIG_COREDUMP
--- a/mm/mmap.c~mm-replace-hardcoded-3%-with-admin_reserve_pages-knob-v8
+++ a/mm/mmap.c
@@ -168,7 +168,7 @@ int __vm_enough_memory(struct mm_struct
* Reserve some for root
*/
if (!cap_sys_admin)
- free -= sysctl_admin_reserve_kbytes >> (PAGE_SHIFT - 10);
+ free -= sysctl_admin_reserve_kbytes >> (PAGE_SHIFT - 10);
if (free > pages)
return 0;
--- a/mm/nommu.c~mm-replace-hardcoded-3%-with-admin_reserve_pages-knob-v8
+++ a/mm/nommu.c
@@ -1932,7 +1932,7 @@ int __vm_enough_memory(struct mm_struct
* Reserve some for root
*/
if (!cap_sys_admin)
- free -= sysctl_admin_reserve_kbytes >> (PAGE_SHIFT - 10);
+ free -= sysctl_admin_reserve_kbytes >> (PAGE_SHIFT - 10);
if (free > pages)
return 0;
_
--
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>
prev parent reply other threads:[~2013-04-08 19:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-08 19:05 [PATCH v8 2/3] mm: replace hardcoded 3% with admin_reserve_pages knob Andrew Shewmaker
2013-04-08 19:39 ` Andrew Morton [this message]
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=20130408123911.6f1101fd988bcc680eb37c46@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=agshew@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ric.masonn@gmail.com \
--cc=simon.jeons@gmail.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;
as well as URLs for NNTP newsgroup(s).