|
@@ -425,15 +425,35 @@ static inline void prep_zero_page(struct page *page, unsigned int order,
|
|
|
|
|
|
#ifdef CONFIG_DEBUG_PAGEALLOC
|
|
#ifdef CONFIG_DEBUG_PAGEALLOC
|
|
unsigned int _debug_guardpage_minorder;
|
|
unsigned int _debug_guardpage_minorder;
|
|
|
|
+bool _debug_pagealloc_enabled __read_mostly;
|
|
bool _debug_guardpage_enabled __read_mostly;
|
|
bool _debug_guardpage_enabled __read_mostly;
|
|
|
|
|
|
|
|
+static int __init early_debug_pagealloc(char *buf)
|
|
|
|
+{
|
|
|
|
+ if (!buf)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ if (strcmp(buf, "on") == 0)
|
|
|
|
+ _debug_pagealloc_enabled = true;
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+early_param("debug_pagealloc", early_debug_pagealloc);
|
|
|
|
+
|
|
static bool need_debug_guardpage(void)
|
|
static bool need_debug_guardpage(void)
|
|
{
|
|
{
|
|
|
|
+ /* If we don't use debug_pagealloc, we don't need guard page */
|
|
|
|
+ if (!debug_pagealloc_enabled())
|
|
|
|
+ return false;
|
|
|
|
+
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
static void init_debug_guardpage(void)
|
|
static void init_debug_guardpage(void)
|
|
{
|
|
{
|
|
|
|
+ if (!debug_pagealloc_enabled())
|
|
|
|
+ return;
|
|
|
|
+
|
|
_debug_guardpage_enabled = true;
|
|
_debug_guardpage_enabled = true;
|
|
}
|
|
}
|
|
|
|
|