]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blobdiff - mm/page_alloc.c
mm/debug_pagealloc: ask users for default setting of debug_pagealloc
[mirror_ubuntu-focal-kernel.git] / mm / page_alloc.c
index fe4378fc0ab6466efbd4b2325f1e4406563616da..36a0a792f4f873611caa5c169eaa56136be79ef3 100644 (file)
@@ -478,7 +478,8 @@ 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
+                       = IS_ENABLED(CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT);
 bool _debug_guardpage_enabled __read_mostly;
 
 static int __init early_debug_pagealloc(char *buf)
@@ -489,6 +490,9 @@ static int __init early_debug_pagealloc(char *buf)
        if (strcmp(buf, "on") == 0)
                _debug_pagealloc_enabled = true;
 
+       if (strcmp(buf, "off") == 0)
+               _debug_pagealloc_enabled = false;
+
        return 0;
 }
 early_param("debug_pagealloc", early_debug_pagealloc);