]> Git Repo - linux.git/commitdiff
PM/Hibernate: use pfn_to_online_page()
authorDavid Hildenbrand <[email protected]>
Tue, 5 Mar 2019 23:42:45 +0000 (15:42 -0800)
committerLinus Torvalds <[email protected]>
Wed, 6 Mar 2019 05:07:14 +0000 (21:07 -0800)
Let's use pfn_to_online_page() instead of pfn_to_page() when checking
for saveable pages to not save/restore offline memory sections.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: David Hildenbrand <[email protected]>
Suggested-by: Michal Hocko <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Acked-by: Pavel Machek <[email protected]>
Acked-by: Rafael J. Wysocki <[email protected]>
Cc: Len Brown <[email protected]>
Cc: Matthew Wilcox <[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: 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 640b2034edd660da46372b38d8eca7b37bd482fc..87e6dd57819ffd091cfd0eee0163311a6e33234a 100644 (file)
@@ -1215,8 +1215,8 @@ static struct page *saveable_highmem_page(struct zone *zone, unsigned long pfn)
        if (!pfn_valid(pfn))
                return NULL;
 
-       page = pfn_to_page(pfn);
-       if (page_zone(page) != zone)
+       page = pfn_to_online_page(pfn);
+       if (!page || page_zone(page) != zone)
                return NULL;
 
        BUG_ON(!PageHighMem(page));
@@ -1277,8 +1277,8 @@ static struct page *saveable_page(struct zone *zone, unsigned long pfn)
        if (!pfn_valid(pfn))
                return NULL;
 
-       page = pfn_to_page(pfn);
-       if (page_zone(page) != zone)
+       page = pfn_to_online_page(pfn);
+       if (!page || page_zone(page) != zone)
                return NULL;
 
        BUG_ON(PageHighMem(page));
This page took 0.052678 seconds and 4 git commands to generate.