linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] mm/debug_pagealloc: enable it by default
@ 2016-01-22 11:44 Christian Borntraeger
  2016-01-25  6:41 ` Joonsoo Kim
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Borntraeger @ 2016-01-22 11:44 UTC (permalink / raw)
  To: linux-kernel
  Cc: peterz, heiko.carstens, akpm, Christian Borntraeger, Joonsoo Kim

since commit 031bc5743f158 ("mm/debug-pagealloc: make debug-pagealloc
boottime configurable") CONFIG_DEBUG_PAGEALLOC is by default a no-op.

This resulted in several unnoticed bugs, e.g.
https://lkml.kernel.org/g/<569F5E29.3090107@de.ibm.com>
or
https://lkml.kernel.org/g/<56A20F30.4050705@de.ibm.com>

as this behaviour change was not even documented in Kconfig.

Let's go back to the original default and reverse the command
line parameter to allow disabling the feature.

Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 Documentation/kernel-parameters.txt | 8 ++++----
 mm/Kconfig.debug                    | 2 ++
 mm/page_alloc.c                     | 6 +++---
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 742f69d..7553c87 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -854,13 +854,13 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 			tracking down these problems.
 
 	debug_pagealloc=
-			[KNL] When CONFIG_DEBUG_PAGEALLOC is set, this
-			parameter enables the feature at boot time. In
-			default, it is disabled. We can avoid allocating huge
+			[KNL] When CONFIG_DEBUG_PAGEALLOC is set to off, this
+			parameter disables the feature at boot time. In
+			default, it is enabled. We can avoid allocating huge
 			chunk of memory for debug pagealloc if we don't enable
 			it at boot time and the system will work mostly same
 			with the kernel built without CONFIG_DEBUG_PAGEALLOC.
-			on: enable the feature
+			off: disable the feature
 
 	debugpat	[X86] Enable PAT debugging
 
diff --git a/mm/Kconfig.debug b/mm/Kconfig.debug
index 957d3da..3f991a4 100644
--- a/mm/Kconfig.debug
+++ b/mm/Kconfig.debug
@@ -25,6 +25,8 @@ config DEBUG_PAGEALLOC
 	  this option cannot be enabled in combination with hibernation as
 	  that would result in incorrect warnings of memory corruption after
 	  a resume because free pages are not saved to the suspend image.
+	  The feature can be disable with the kernel parameter
+	  debug_pagealloc=off.
 
 config PAGE_POISONING
 	bool
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 9d666df..8a03efd 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -479,7 +479,7 @@ void prep_compound_page(struct page *page, unsigned int order)
 
 #ifdef CONFIG_DEBUG_PAGEALLOC
 unsigned int _debug_guardpage_minorder;
-bool _debug_pagealloc_enabled __read_mostly;
+bool _debug_pagealloc_enabled __read_mostly = true;
 bool _debug_guardpage_enabled __read_mostly;
 
 static int __init early_debug_pagealloc(char *buf)
@@ -487,8 +487,8 @@ static int __init early_debug_pagealloc(char *buf)
 	if (!buf)
 		return -EINVAL;
 
-	if (strcmp(buf, "on") == 0)
-		_debug_pagealloc_enabled = true;
+	if (strcmp(buf, "off") == 0)
+		_debug_pagealloc_enabled = false;
 
 	return 0;
 }
-- 
2.3.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-01-26  6:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-22 11:44 [PATCH/RFC] mm/debug_pagealloc: enable it by default Christian Borntraeger
2016-01-25  6:41 ` Joonsoo Kim
2016-01-25  8:21   ` Christian Borntraeger
2016-01-25 19:22     ` Dave Jones
2016-01-25 19:38       ` Dave Jones
2016-01-25 19:51         ` Christian Borntraeger
2016-01-26  6:18           ` Joonsoo Kim

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).