The patch titled Subject: mm: hwpoison: handle non-anonymous THP correctly has been added to the -mm tree. Its filename is mm-hwpoison-handle-non-anonymous-thp-correctly.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-hwpoison-handle-non-anonymous-thp-correctly.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-hwpoison-handle-non-anonymous-thp-correctly.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Yang Shi <shy828301@xxxxxxxxx> Subject: mm: hwpoison: handle non-anonymous THP correctly Currently hwpoison doesn't handle non-anonymous THP, but since v4.8 THP support for tmpfs and read-only file cache has been added. They could be offlined by split THP, just like anonymous THP. Link: https://lkml.kernel.org/r/20211020210755.23964-7-shy828301@xxxxxxxxx Acked-by: Naoya Horiguchi <naoya.horiguchi@xxxxxxx> Signed-off-by: Yang Shi <shy828301@xxxxxxxxx> Cc: Hugh Dickins <hughd@xxxxxxxxxx> Cc: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: Oscar Salvador <osalvador@xxxxxxx> Cc: Peter Xu <peterx@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memory-failure.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) --- a/mm/memory-failure.c~mm-hwpoison-handle-non-anonymous-thp-correctly +++ a/mm/memory-failure.c @@ -1444,14 +1444,11 @@ static int identify_page_state(unsigned static int try_to_split_thp_page(struct page *page, const char *msg) { lock_page(page); - if (!PageAnon(page) || unlikely(split_huge_page(page))) { + if (unlikely(split_huge_page(page))) { unsigned long pfn = page_to_pfn(page); unlock_page(page); - if (!PageAnon(page)) - pr_info("%s: %#lx: non anonymous thp\n", msg, pfn); - else - pr_info("%s: %#lx: thp split failed\n", msg, pfn); + pr_info("%s: %#lx: thp split failed\n", msg, pfn); put_page(page); return -EBUSY; } _ Patches currently in -mm which might be from shy828301@xxxxxxxxx are mm-hwpoison-remove-the-unnecessary-thp-check.patch mm-filemap-check-if-thp-has-hwpoisoned-subpage-for-pmd-page-fault.patch mm-filemap-coding-style-cleanup-for-filemap_map_pmd.patch mm-hwpoison-refactor-refcount-check-handling.patch mm-shmem-dont-truncate-page-if-memory-failure-happens.patch mm-hwpoison-handle-non-anonymous-thp-correctly.patch mm-migrate-make-demotion-knob-depend-on-migration.patch