Skip to content

Commit

Permalink
Revert "mm/memory-failure.c: fix race with changing page compound again"
Browse files Browse the repository at this point in the history
Reverts commit 888af27 ("mm/memory-failure.c: fix race with changing
page compound again") because now we fetch the page refcount under
hugetlb_lock in try_memory_failure_hugetlb() so that the race check is no
longer necessary.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Naoya Horiguchi <[email protected]>
Suggested-by: Miaohe Lin <[email protected]>
Reviewed-by: Miaohe Lin <[email protected]>
Reviewed-by: Mike Kravetz <[email protected]>
Cc: Miaohe Lin <[email protected]>
Cc: Yang Shi <[email protected]>
Cc: Dan Carpenter <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
nhoriguchi authored and akpm00 committed Apr 29, 2022
1 parent f361e24 commit 2ba2b00
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -3251,7 +3251,6 @@ enum mf_action_page_type {
MF_MSG_BUDDY,
MF_MSG_DAX,
MF_MSG_UNSPLIT_THP,
MF_MSG_DIFFERENT_PAGE_SIZE,
MF_MSG_UNKNOWN,
};

Expand Down
1 change: 0 additions & 1 deletion include/ras/ras_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,6 @@ TRACE_EVENT(aer_event,
EM ( MF_MSG_BUDDY, "free buddy page" ) \
EM ( MF_MSG_DAX, "dax page" ) \
EM ( MF_MSG_UNSPLIT_THP, "unsplit thp" ) \
EM ( MF_MSG_DIFFERENT_PAGE_SIZE, "different page size" ) \
EMe ( MF_MSG_UNKNOWN, "unknown page" )

/*
Expand Down
11 changes: 0 additions & 11 deletions mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,6 @@ static const char * const action_page_types[] = {
[MF_MSG_BUDDY] = "free buddy page",
[MF_MSG_DAX] = "dax page",
[MF_MSG_UNSPLIT_THP] = "unsplit thp",
[MF_MSG_DIFFERENT_PAGE_SIZE] = "different page size",
[MF_MSG_UNKNOWN] = "unknown page",
};

Expand Down Expand Up @@ -1605,16 +1604,6 @@ static int try_memory_failure_hugetlb(unsigned long pfn, int flags, int *hugetlb
return res == MF_RECOVERED ? 0 : -EBUSY;
}

/*
* The page could have changed compound pages due to race window.
* If this happens just bail out.
*/
if (!PageHuge(p) || compound_head(p) != head) {
action_result(pfn, MF_MSG_DIFFERENT_PAGE_SIZE, MF_IGNORED);
res = -EBUSY;
goto out;
}

page_flags = head->flags;

/*
Expand Down

0 comments on commit 2ba2b00

Please sign in to comment.