lkml.org 
[lkml]   [2022]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/3] mm/memory-failure.c: avoid false-postive PageSwapCache test
Date
PageSwapCache is only reliable when PageAnon is true because PG_swapcache
serves as PG_owner_priv_1 which can be used by fs if it's pagecache page.
So we should test PageAnon to distinguish pagecache page from swapcache
page to avoid false-postive PageSwapCache test.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
mm/memory-failure.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index ef402b490663..2e97302d62e4 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -2262,7 +2262,7 @@ static int __soft_offline_page(struct page *page)
return 0;
}

- if (!PageHuge(page) && PageLRU(page) && !PageSwapCache(page))
+ if (!PageHuge(page) && PageLRU(page) && !PageAnon(page))
/*
* Try to invalidate first. This should work for
* non dirty unmapped page cache pages.
--
2.23.0
\
 
 \ /
  Last update: 2022-04-07 17:32    [W:2.055 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site