diff mbox series

[v2] hibernate: pageoffline may be first judged

Message ID 32aa0d9b94c4f5ee92cb07cc95dcf21a61b41ad8.camel@kylinos.cn (mailing list archive)
State New
Headers show
Series [v2] hibernate: pageoffline may be first judged | expand

Commit Message

lijun April 2, 2025, 8:44 a.m. UTC
From: Li Jun <lijun01@kylinos.cn>
Date: Mon, 10 Feb 2025 10:40:58 +0800
Subject: [PATCH v2] hibernate: pageoffline may be first judged

'PageReserved' and 'PageOffline' have weights greater
than 'is_forbidden' and 'is_free'.so,PageReserved
and PageOffline should be first judged.
just as the page is free,but is reserved.

Signed-off-by: Li Jun <lijun01@kylinos.cn>
---
 kernel/power/snapshot.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

    if (page_is_guard(page))
@@ -1387,9 +1387,6 @@ static struct page *saveable_page(struct zone
*zone, unsigned long pfn)
 
    BUG_ON(PageHighMem(page));
 
-   if (swsusp_page_is_forbidden(page) || swsusp_page_is_free(page))
-       return NULL;
-
    if (PageOffline(page))
        return NULL;
 
@@ -1397,6 +1394,9 @@ static struct page *saveable_page(struct zone
*zone, unsigned long pfn)
        && (!kernel_page_present(page) || pfn_is_nosave(pfn)))
        return NULL;
 
+   if (swsusp_page_is_forbidden(page) || swsusp_page_is_free(page))
+       return NULL;
+                                                                      
                                                                       
                                                                       
                         
    if (page_is_guard(page))
        return NULL;
diff mbox series

Patch

diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index c9fb559a6399..dfbccddb28f1 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -1328,10 +1328,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))
+   if (PageReserved(page) || PageOffline(page))
        return NULL;
 
-   if (PageReserved(page) || PageOffline(page))
+   if (swsusp_page_is_forbidden(page) ||  swsusp_page_is_free(page))
        return NULL;