From: Kirill A. Shutemov Date: Tue, 8 Sep 2015 21:59:28 +0000 (-0700) Subject: thp: decrement refcount on huge zero page if it is split X-Git-Tag: v4.1.12-92~18^2^2~100 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7647606ad4bc81c18eab82d5474751b45fb412ef;p=users%2Fjedix%2Flinux-maple.git thp: decrement refcount on huge zero page if it is split Orabug: 22913653 The DAX code neglected to put the refcount on the huge zero page. Also we must notify on splits. Signed-off-by: Kirill A. Shutemov Signed-off-by: Matthew Wilcox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds (cherry picked from commit 5b701b846aad7909d20693bcced2522d0ce8d1bc) Signed-off-by: Dan Duval --- diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 9f9a536465900..116e8fce6050b 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2954,7 +2954,9 @@ again: if (unlikely(!pmd_trans_huge(*pmd))) goto unlock; if (vma_is_dax(vma)) { - pmdp_huge_clear_flush(vma, haddr, pmd); + pmd_t _pmd = pmdp_huge_clear_flush_notify(vma, haddr, pmd); + if (is_huge_zero_pmd(_pmd)) + put_huge_zero_page(); } else if (is_huge_zero_pmd(*pmd)) { __split_huge_zero_page_pmd(vma, haddr, pmd); } else {