Skip to content

Commit

Permalink
mm/memory-failure: remove obsolete MF_MSG_DIFFERENT_COMPOUND
Browse files Browse the repository at this point in the history
The page cannot become compound pages again just after a folio is split as
an extra refcnt is held.  So the MF_MSG_DIFFERENT_COMPOUND case is
obsolete and can be removed to get rid of this false assumption and code
burden.  But add one WARN_ON() here to keep the situation clear.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Miaohe Lin <[email protected]>
Cc: Borislav Petkov (AMD) <[email protected]>
Cc: Naoya Horiguchi <[email protected]>
Cc: Tony Luck <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
MiaoheLin authored and akpm00 committed Jul 12, 2024
1 parent a5ea521 commit 8a78882
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
1 change: 0 additions & 1 deletion include/ras/ras_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ TRACE_EVENT(aer_event,
#define MF_PAGE_TYPE \
EM ( MF_MSG_KERNEL, "reserved kernel page" ) \
EM ( MF_MSG_KERNEL_HIGH_ORDER, "high-order kernel page" ) \
EM ( MF_MSG_DIFFERENT_COMPOUND, "different compound page after locking" ) \
EM ( MF_MSG_HUGE, "huge page" ) \
EM ( MF_MSG_FREE_HUGE, "free huge page" ) \
EM ( MF_MSG_GET_HWPOISON, "get hwpoison page" ) \
Expand Down
19 changes: 3 additions & 16 deletions mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,6 @@ static const char *action_name[] = {
static const char * const action_page_types[] = {
[MF_MSG_KERNEL] = "reserved kernel page",
[MF_MSG_KERNEL_HIGH_ORDER] = "high-order kernel page",
[MF_MSG_DIFFERENT_COMPOUND] = "different compound page after locking",
[MF_MSG_HUGE] = "huge page",
[MF_MSG_FREE_HUGE] = "free huge page",
[MF_MSG_GET_HWPOISON] = "get hwpoison page",
Expand Down Expand Up @@ -2349,22 +2348,10 @@ int memory_failure(unsigned long pfn, int flags)

/*
* We're only intended to deal with the non-Compound page here.
* However, the page could have changed compound pages due to
* race window. If this happens, we could try again to hopefully
* handle the page next round.
* The page cannot become compound pages again as folio has been
* splited and extra refcnt is held.
*/
if (folio_test_large(folio)) {
if (retry) {
ClearPageHWPoison(p);
folio_unlock(folio);
folio_put(folio);
flags &= ~MF_COUNT_INCREASED;
retry = false;
goto try_again;
}
res = action_result(pfn, MF_MSG_DIFFERENT_COMPOUND, MF_IGNORED);
goto unlock_page;
}
WARN_ON(folio_test_large(folio));

/*
* We use page flags to determine what action should be taken, but
Expand Down

0 comments on commit 8a78882

Please sign in to comment.