Skip to content

Commit 8a78882

Browse files
MiaoheLinakpm00
authored andcommitted
mm/memory-failure: remove obsolete MF_MSG_DIFFERENT_COMPOUND
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]>
1 parent a5ea521 commit 8a78882

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

include/ras/ras_event.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ TRACE_EVENT(aer_event,
356356
#define MF_PAGE_TYPE \
357357
EM ( MF_MSG_KERNEL, "reserved kernel page" ) \
358358
EM ( MF_MSG_KERNEL_HIGH_ORDER, "high-order kernel page" ) \
359-
EM ( MF_MSG_DIFFERENT_COMPOUND, "different compound page after locking" ) \
360359
EM ( MF_MSG_HUGE, "huge page" ) \
361360
EM ( MF_MSG_FREE_HUGE, "free huge page" ) \
362361
EM ( MF_MSG_GET_HWPOISON, "get hwpoison page" ) \

mm/memory-failure.c

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,6 @@ static const char *action_name[] = {
919919
static const char * const action_page_types[] = {
920920
[MF_MSG_KERNEL] = "reserved kernel page",
921921
[MF_MSG_KERNEL_HIGH_ORDER] = "high-order kernel page",
922-
[MF_MSG_DIFFERENT_COMPOUND] = "different compound page after locking",
923922
[MF_MSG_HUGE] = "huge page",
924923
[MF_MSG_FREE_HUGE] = "free huge page",
925924
[MF_MSG_GET_HWPOISON] = "get hwpoison page",
@@ -2349,22 +2348,10 @@ int memory_failure(unsigned long pfn, int flags)
23492348

23502349
/*
23512350
* We're only intended to deal with the non-Compound page here.
2352-
* However, the page could have changed compound pages due to
2353-
* race window. If this happens, we could try again to hopefully
2354-
* handle the page next round.
2351+
* The page cannot become compound pages again as folio has been
2352+
* splited and extra refcnt is held.
23552353
*/
2356-
if (folio_test_large(folio)) {
2357-
if (retry) {
2358-
ClearPageHWPoison(p);
2359-
folio_unlock(folio);
2360-
folio_put(folio);
2361-
flags &= ~MF_COUNT_INCREASED;
2362-
retry = false;
2363-
goto try_again;
2364-
}
2365-
res = action_result(pfn, MF_MSG_DIFFERENT_COMPOUND, MF_IGNORED);
2366-
goto unlock_page;
2367-
}
2354+
WARN_ON(folio_test_large(folio));
23682355

23692356
/*
23702357
* We use page flags to determine what action should be taken, but

0 commit comments

Comments
 (0)