PM/Hibernate: exclude all PageOffline() pages
authorDavid Hildenbrand <[email protected]>
Tue, 5 Mar 2019 23:42:50 +0000 (15:42 -0800)
committerLinus Torvalds <[email protected]>
Wed, 6 Mar 2019 05:07:14 +0000 (21:07 -0800)
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.

[[email protected]: v2]
Link: http://lkml.kernel.org/r/[email protected]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: David Hildenbrand <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Acked-by: Rafael J. Wysocki <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Alexander Duyck <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Cc: Baoquan He <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: Boris Ostrovsky <[email protected]>
Cc: Christian Hansen <[email protected]>
Cc: Dave Young <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Cc: Jonathan Corbet <[email protected]>
Cc: Juergen Gross <[email protected]>
Cc: Julien Freche <[email protected]>
Cc: Kairui Song <[email protected]>
Cc: Kazuhito Hagio <[email protected]>
Cc: "Kirill A. Shutemov" <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Cc: "K. Y. Srinivasan" <[email protected]>
Cc: Lianbo Jiang <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Miles Chen <[email protected]>
Cc: Nadav Amit <[email protected]>
Cc: Naoya Horiguchi <[email protected]>
Cc: Omar Sandoval <[email protected]>
Cc: Pankaj gupta <[email protected]>
Cc: Pavel Tatashin <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Stephen Hemminger <[email protected]>
Cc: Stephen Rothwell <[email protected]>
Cc: Vitaly Kuznetsov <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Xavier Deguillard <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
kernel/power/snapshot.c

index 87e6dd57819ffd091cfd0eee0163311a6e33234a..4802b039b89f54f60d458405a7db128ff1c09648 100644 (file)
@@ -1221,8 +1221,10 @@ static struct page *saveable_highmem_page(struct zone *zone, unsigned long pfn)
 
        BUG_ON(!PageHighMem(page));
 
-       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;