Commit f1c1e9f7 authored by Joonsoo Kim's avatar Joonsoo Kim Committed by Linus Torvalds

mm/debug_pagealloc.c: don't allocate page_ext if we don't use guard page

What debug_pagealloc does is just mapping/unmapping page table.
Basically, it doesn't need additional memory space to memorize
something.  But, with guard page feature, it requires additional memory
to distinguish if the page is for guard or not.  Guard page is only used
when debug_guardpage_minorder is non-zero so this patch removes
additional memory allocation (page_ext) if debug_guardpage_minorder is

It saves memory if we just use debug_pagealloc and not guard page.

Link: default avatarJoonsoo Kim <>
Reviewed-by: sergey-senozhatsky's avatarSergey Senozhatsky <>
Acked-by: default avatarVlastimil Babka <>
Cc: Minchan Kim <>
Cc: Michal Hocko <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent acbc15a4
......@@ -607,6 +607,9 @@ static bool need_debug_guardpage(void)
if (!debug_pagealloc_enabled())
return false;
if (!debug_guardpage_minorder())
return false;
return true;
......@@ -615,6 +618,9 @@ static void init_debug_guardpage(void)
if (!debug_pagealloc_enabled())
if (!debug_guardpage_minorder())
_debug_guardpage_enabled = true;
......@@ -635,7 +641,7 @@ static int __init debug_guardpage_minorder_setup(char *buf)
pr_info("Setting debug_guardpage_minorder to %lu\n", res);
return 0;
__setup("debug_guardpage_minorder=", debug_guardpage_minorder_setup);
early_param("debug_guardpage_minorder", debug_guardpage_minorder_setup);
static inline bool set_page_guard(struct zone *zone, struct page *page,
unsigned int order, int migratetype)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment