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/[email protected] Signed-off-by: Miaohe Lin <[email protected]> Acked-by: Naoya Horiguchi <[email protected]> Cc: Kefeng Wang <[email protected]> Cc: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 52ae298 commit 7a8817f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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)