[PATCH v2 8/8] PM / Hibernate: exclude all PageOffline() pages

David Hildenbrand david at redhat.com
Thu Nov 22 10:06:27 UTC 2018

The content of pages that are marked PG_offline is not of interest
(e.g. inflated by a balloon driver), let's skip these pages.

In saveable_highmem_page(), move the PageReserved() check to a new
check along with the PageOffline() check to separate it from the
swsusp checks.

Cc: "Rafael J. Wysocki" <rjw at rjwysocki.net>
Cc: Pavel Machek <pavel at ucw.cz>
Cc: Len Brown <len.brown at intel.com>
Cc: Andrew Morton <akpm at linux-foundation.org>
Cc: Matthew Wilcox <willy at infradead.org>
Cc: Michal Hocko <mhocko at suse.com>
Cc: "Michael S. Tsirkin" <mst at redhat.com>
Acked-by: Pavel Machek <pavel at ucw.cz>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki at intel.com>
Signed-off-by: David Hildenbrand <david at redhat.com>
 kernel/power/snapshot.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index 87e6dd57819f..4802b039b89f 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -1221,8 +1221,10 @@ static struct page *saveable_highmem_page(struct zone *zone, unsigned long pfn)
-	if (swsusp_page_is_forbidden(page) ||  swsusp_page_is_free(page) ||
-	    PageReserved(page))
+	if (swsusp_page_is_forbidden(page) ||  swsusp_page_is_free(page))
+		return NULL;
+	if (PageReserved(page) || PageOffline(page))
 		return NULL;
 	if (page_is_guard(page))
@@ -1286,6 +1288,9 @@ static struct page *saveable_page(struct zone *zone, unsigned long pfn)
 	if (swsusp_page_is_forbidden(page) || swsusp_page_is_free(page))
 		return NULL;
+	if (PageOffline(page))
+		return NULL;
 	if (PageReserved(page)
 	    && (!kernel_page_present(page) || pfn_is_nosave(pfn)))
 		return NULL;

More information about the devel mailing list