提交 ef526b17 编写于 作者: M Miaohe Lin 提交者: akpm

mm/memory-failure.c: dissolve truncated hugetlb page

If me_huge_page meets a truncated but not yet freed hugepage, it won't be
dissolved even if we hold the last refcnt. It's because the hugepage has
NULL page_mapping while it's not anonymous hugepage too. Thus we lose the
last chance to dissolve it into buddy to save healthy subpages. Remove
PageAnon check to handle these hugepages too.

Link: https://lkml.kernel.org/r/20220414114941.11223-3-linmiaohe@huawei.comSigned-off-by: NMiaohe Lin <linmiaohe@huawei.com>
Acked-by: NNaoya Horiguchi <naoya.horiguchi@nec.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Yang Shi <shy828301@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
上级 3f871370
...@@ -1040,11 +1040,10 @@ static int me_huge_page(struct page_state *ps, struct page *p) ...@@ -1040,11 +1040,10 @@ static int me_huge_page(struct page_state *ps, struct page *p)
res = MF_FAILED; res = MF_FAILED;
unlock_page(hpage); unlock_page(hpage);
/* /*
* migration entry prevents later access on error anonymous * migration entry prevents later access on error hugepage,
* hugepage, so we can free and dissolve it into buddy to * so we can free and dissolve it into buddy to save healthy
* save healthy subpages. * subpages.
*/ */
if (PageAnon(hpage))
put_page(hpage); put_page(hpage);
if (__page_handle_poison(p)) { if (__page_handle_poison(p)) {
page_ref_inc(p); page_ref_inc(p);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册