Skip to content

Commit

Permalink
mm: memory-failure: add PageOffline() check
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
MiaoheLin authored and akpm00 committed Sep 2, 2023
1 parent 52ae298 commit 7a8817f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

/*
Expand Down

0 comments on commit 7a8817f

Please sign in to comment.