Skip to content

Commit b4e61fc

Browse files
vxuyuakpm00
authored andcommitted
Revert "mm/memory-failure.c: skip huge_zero_page in memory_failure()"
Patch series "mm/memory-failure: rework fix on huge_zero_page splitting". This patch (of 2): This reverts commit d173d54. The commit d173d54 ("mm/memory-failure.c: skip huge_zero_page in memory_failure()") explicitly skips huge_zero_page in memory_failure(), in order to avoid triggering VM_BUG_ON_PAGE on huge_zero_page in split_huge_page_to_list(). This works, but Yang Shi thinks that, Raising BUG is overkilling for splitting huge_zero_page. The huge_zero_page can't be met from normal paths other than memory failure, but memory failure is a valid caller. So I tend to replace the BUG to WARN + returning -EBUSY. If we don't care about the reason code in memory failure, we don't have to touch memory failure. And for the issue that huge_zero_page will be set PG_has_hwpoisoned, Yang Shi comments that, The anonymous page fault doesn't check if the page is poisoned or not since it typically gets a fresh allocated page and assumes the poisoned page (isolated successfully) can't be reallocated again. But huge zero page and base zero page are reused every time. So no matter what fix we pick, the issue is always there. Finally, Yang, David, Anshuman and Naoya all agree to fix the bug, i.e., to split huge_zero_page, in split_huge_page_to_list(). This reverts the commit d173d54 ("mm/memory-failure.c: skip huge_zero_page in memory_failure()"), and the original bug will be fixed by the next patch. Link: https://lkml.kernel.org/r/872cefb182ba1dd686b0e7db1e6b2ebe5a4fff87.1651039624.git.xuyu@linux.alibaba.com Fixes: d173d54 ("mm/memory-failure.c: skip huge_zero_page in memory_failure()") Fixes: 6a46079 ("HWPOISON: The high level memory error handler in the VM v7") Signed-off-by: Xu Yu <[email protected]> Suggested-by: Yang Shi <[email protected]> Reviewed-by: Yang Shi <[email protected]> Reviewed-by: Miaohe Lin <[email protected]> Cc: Naoya Horiguchi <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 38d741c commit b4e61fc

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

mm/memory-failure.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,19 +1860,6 @@ int memory_failure(unsigned long pfn, int flags)
18601860
}
18611861

18621862
if (PageTransHuge(hpage)) {
1863-
/*
1864-
* Bail out before SetPageHasHWPoisoned() if hpage is
1865-
* huge_zero_page, although PG_has_hwpoisoned is not
1866-
* checked in set_huge_zero_page().
1867-
*
1868-
* TODO: Handle memory failure of huge_zero_page thoroughly.
1869-
*/
1870-
if (is_huge_zero_page(hpage)) {
1871-
action_result(pfn, MF_MSG_UNSPLIT_THP, MF_IGNORED);
1872-
res = -EBUSY;
1873-
goto unlock_mutex;
1874-
}
1875-
18761863
/*
18771864
* The flag must be set after the refcount is bumped
18781865
* otherwise it may race with THP split.

0 commit comments

Comments
 (0)