From 6f4a4c2a6c248e04b113ab0dede37134421dd935 Mon Sep 17 00:00:00 2001 From: Vinayak Menon Date: Wed, 5 Apr 2017 10:49:14 +0530 Subject: [PATCH] mm: allow page poisoning to be enabled by default. Add a config option to enable page poisoning by default. The kernel command line option "page_poison" can be used to change the behaviour during boot. Change-Id: Ie70763841191a722b1c6125dfad119a29ed0f605 Signed-off-by: Vinayak Menon --- mm/Kconfig.debug | 10 ++++++++++ mm/page_poison.c | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug index afab093558d2..7470fd60fc59 100644 --- a/mm/Kconfig.debug +++ b/mm/Kconfig.debug @@ -65,6 +65,16 @@ config PAGE_POISONING If unsure, say N +config PAGE_POISONING_ENABLE_DEFAULT + bool "Enable page poisoning by default?" + default n + depends on PAGE_POISONING + ---help--- + Enable page poisoning of free pages by default? This value + can be overridden by page_poison=off|on. This can be used + to avoid passing the kernel parameter and let page poisoning + feature enabled by default. + config PAGE_POISONING_NO_SANITY depends on PAGE_POISONING bool "Only poison, don't sanity check" diff --git a/mm/page_poison.c b/mm/page_poison.c index eb3c4f1aade3..c8cf230dbfcb 100644 --- a/mm/page_poison.c +++ b/mm/page_poison.c @@ -6,7 +6,8 @@ #include #include -static bool want_page_poisoning __read_mostly; +static bool want_page_poisoning __read_mostly + = IS_ENABLED(CONFIG_PAGE_POISONING_ENABLE_DEFAULT); static int early_page_poison_param(char *buf) {