Skip to content

Commit 7a8817f

Browse files
MiaoheLinakpm00
authored andcommitted
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>
1 parent 52ae298 commit 7a8817f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

mm/memory-failure.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,7 @@ static bool hwpoison_user_mappings(struct page *p, unsigned long pfn,
15621562
* Here we are interested only in user-mapped pages, so skip any
15631563
* other types of pages.
15641564
*/
1565-
if (PageReserved(p) || PageSlab(p) || PageTable(p))
1565+
if (PageReserved(p) || PageSlab(p) || PageTable(p) || PageOffline(p))
15661566
return true;
15671567
if (!(PageLRU(hpage) || PageHuge(p)))
15681568
return true;
@@ -2533,7 +2533,8 @@ int unpoison_memory(unsigned long pfn)
25332533
goto unlock_mutex;
25342534
}
25352535

2536-
if (folio_test_slab(folio) || PageTable(&folio->page) || folio_test_reserved(folio))
2536+
if (folio_test_slab(folio) || PageTable(&folio->page) ||
2537+
folio_test_reserved(folio) || PageOffline(&folio->page))
25372538
goto unlock_mutex;
25382539

25392540
/*

0 commit comments

Comments
 (0)