From: Naoya Horiguchi <[email protected]> Subject: mm: soft offline: split thp at the beginning of soft_offline_page()
When we try to soft-offline a thp tail page, put_page() is called on the tail page unthinkingly and VM_BUG_ON is triggered in put_compound_page(). This patch splits thp before going into the main body of soft-offlining. Signed-off-by: Naoya Horiguchi <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Tony Luck <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Wu Fengguang <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> --- mm/memory-failure.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff -puN mm/memory-failure.c~mm-soft-offline-split-thp-at-the-beginning-of-soft_offline_page mm/memory-failure.c --- a/mm/memory-failure.c~mm-soft-offline-split-thp-at-the-beginning-of-soft_offline_page +++ a/mm/memory-failure.c @@ -1476,9 +1476,17 @@ int soft_offline_page(struct page *page, { int ret; unsigned long pfn = page_to_pfn(page); + struct page *hpage = compound_trans_head(page); if (PageHuge(page)) return soft_offline_huge_page(page, flags); + if (PageTransHuge(hpage)) { + if (PageAnon(hpage) && unlikely(split_huge_page(hpage))) { + pr_info("soft offline: %#lx: failed to split THP\n", + pfn); + return -EBUSY; + } + } ret = get_any_page(page, pfn, flags); if (ret < 0) _ -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
