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.3-rc1~40^2~117 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=5b701b846aad7909d20693bcced2522d0ce8d1bc;p=uclinux-h8%2Flinux.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 {