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-Url: https://git.stricted.de/?a=commitdiff_plain;h=5b701b846aad7909d20693bcced2522d0ce8d1bc;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git thp: decrement refcount on huge zero page if it is split 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 --- diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 5df0d1597c15..7510b6f683e9 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -2978,7 +2978,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 {