summaryrefslogtreecommitdiff
path: root/mm/memory-failure.c
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2023-07-27 19:56:43 +0800
committerAndrew Morton <akpm@linux-foundation.org>2023-09-02 15:17:33 -0700
commit7a8817f2c96e98d5e65a59e34ba9ea1ff6ed23bc (patch)
treecc9c0825ca036ba8d3cc32144ed1f15f8b0b0a11 /mm/memory-failure.c
parent52ae298e3e5c9be5bb95e1c6d9199e5210f2a156 (diff)
downloadlwn-7a8817f2c96e98d5e65a59e34ba9ea1ff6ed23bc.tar.gz
lwn-7a8817f2c96e98d5e65a59e34ba9ea1ff6ed23bc.zip
mm: memory-failure: add PageOffline() check
Memory failure is not interested in logically offlined pages. Skip this type of page. Link: https://lkml.kernel.org/r/20230727115643.639741-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com> Cc: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/memory-failure.c')
-rw-r--r--mm/memory-failure.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 881c35ef1daa..ed29d720ee76 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -1562,7 +1562,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn,
* Here we are interested only in user-mapped pages, so skip any
* other types of pages.
*/
- if (PageReserved(p) || PageSlab(p) || PageTable(p))
+ if (PageReserved(p) || PageSlab(p) || PageTable(p) || PageOffline(p))
return true;
if (!(PageLRU(hpage) || PageHuge(p)))
return true;
@@ -2533,7 +2533,8 @@ int unpoison_memory(unsigned long pfn)
goto unlock_mutex;
}
- if (folio_test_slab(folio) || PageTable(&folio->page) || folio_test_reserved(folio))
+ if (folio_test_slab(folio) || PageTable(&folio->page) ||
+ folio_test_reserved(folio) || PageOffline(&folio->page))
goto unlock_mutex;
/*