+ mm-add-config-option-to-select-the-initial-overcommit-mode.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm: add config option to select the initial overcommit mode
has been added to the -mm tree.  Its filename is
     mm-add-config-option-to-select-the-initial-overcommit-mode.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-add-config-option-to-select-the-initial-overcommit-mode.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-add-config-option-to-select-the-initial-overcommit-mode.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Sebastian Frias <sf84@xxxxxxxxxxx>
Subject: 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@xxxxxxxxxxx
Signed-off-by: Sebastian Frias <sf84@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/Kconfig |   32 ++++++++++++++++++++++++++++++++
 mm/util.c  |    6 ++++++
 2 files changed, 38 insertions(+)

diff -puN mm/Kconfig~mm-add-config-option-to-select-the-initial-overcommit-mode mm/Kconfig
--- a/mm/Kconfig~mm-add-config-option-to-select-the-initial-overcommit-mode
+++ a/mm/Kconfig
@@ -438,6 +438,38 @@ choice
 	  benefit.
 endchoice
 
+choice
+	prompt "Overcommit Mode"
+	default OVERCOMMIT_GUESS
+	depends on EXPERT
+	help
+	  Selects the initial value for Overcommit mode.
+
+	  NOTE: The overcommit mode can be changed dynamically through sysctl.
+
+	config OVERCOMMIT_GUESS
+		bool "Guess"
+	help
+	  Selecting this option forces the initial value of overcommit mode to
+	  "Guess" overcommits. This is the default value.
+	  See Documentation/vm/overcommit-accounting for more information.
+
+	config OVERCOMMIT_ALWAYS
+		bool "Always"
+	help
+	  Selecting this option forces the initial value of overcommit mode to
+	  "Always" overcommit.
+	  See Documentation/vm/overcommit-accounting for more information.
+
+	config OVERCOMMIT_NEVER
+		bool "Never"
+	help
+	  Selecting this option forces the initial value of overcommit mode to
+	  "Never" overcommit.
+	  See Documentation/vm/overcommit-accounting for more information.
+
+endchoice
+
 #
 # UP and nommu archs use km based percpu allocator
 #
diff -puN mm/util.c~mm-add-config-option-to-select-the-initial-overcommit-mode mm/util.c
--- a/mm/util.c~mm-add-config-option-to-select-the-initial-overcommit-mode
+++ a/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;
_

Patches currently in -mm which might be from sf84@xxxxxxxxxxx are

mm-add-config-option-to-select-the-initial-overcommit-mode.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux