Skip to content

Commit

Permalink
PM/Hibernate: do not count debug pages as savable
Browse files Browse the repository at this point in the history
When debugging with CONFIG_DEBUG_PAGEALLOC and debug_guardpage_minorder >
0, we have lot of free pages that are not marked so.  Snapshot code
account them as savable, what cause hibernate memory preallocation
failure.

It is pretty hard to make hibernate allocation succeed with
debug_guardpage_minorder=1.  This change at least make it possible when
system has relatively big amount of RAM.

Signed-off-by: Stanislaw Gruszka <[email protected]>
Acked-by: Rafael J. Wysocki <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: Christoph Lameter <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Pekka Enberg <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Stanislaw Gruszka authored and torvalds committed Jan 11, 2012
1 parent c0a32fc commit c6968e7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kernel/power/snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,9 @@ static struct page *saveable_highmem_page(struct zone *zone, unsigned long pfn)
PageReserved(page))
return NULL;

if (page_is_guard(page))
return NULL;

return page;
}

Expand Down Expand Up @@ -920,6 +923,9 @@ static struct page *saveable_page(struct zone *zone, unsigned long pfn)
&& (!kernel_page_present(page) || pfn_is_nosave(pfn)))
return NULL;

if (page_is_guard(page))
return NULL;

return page;
}

Expand Down

0 comments on commit c6968e7

Please sign in to comment.