Skip to content

Commit

Permalink
Fwd: [PATCH] mm: add config option to select the initial overcommit mode
Browse files Browse the repository at this point in the history
Hi,

Using checkpatch.pl on the forwarded patch results in:

WARNING: please write a paragraph that describes the config symbol fully
torvalds#57: FILE: mm/Kconfig:451:
+       config OVERCOMMIT_GUESS

WARNING: please write a paragraph that describes the config symbol fully
torvalds#64: FILE: mm/Kconfig:458:
+       config OVERCOMMIT_ALWAYS

but there is a 'help' section for those 'config' sections.
NOTE: I followed the same indentation than the code laying just above the place where I inserted mine.

I think it is a false positive, what do you think?

Best regards,

Sebastian

Message-ID: <5731CC6E.3080807@laposte.net>
Date: Tue, 10 May 2016 13:56:30 +0200
From: Sebastian Frias <sf84@laposte.net>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
To: <linux-mm@kvack.org>, Andrew Morton <akpm@linux-foundation.org>, "Michal
 Hocko" <mhocko@suse.com>, Linus Torvalds <torvalds@linux-foundation.org>
CC: LKML <linux-kernel@vger.kernel.org>, mason <slash.tmp@free.fr>
Subject: [PATCH] mm: add config option to select the initial overcommit mode
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0

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.

Signed-off-by: Sebastian Frias <sf84@laposte.net>
  • Loading branch information
Sebastian Frias authored and 0day robot committed May 10, 2016
1 parent 44549e8 commit b6b53da
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
32 changes: 32 additions & 0 deletions mm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,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
#
Expand Down
6 changes: 6 additions & 0 deletions mm/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,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;
Expand Down

0 comments on commit b6b53da

Please sign in to comment.