]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
thp: decrement refcount on huge zero page if it is split
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Tue, 8 Sep 2015 21:59:28 +0000 (14:59 -0700)
committerDan Duval <dan.duval@oracle.com>
Wed, 7 Dec 2016 17:19:47 +0000 (12:19 -0500)
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 <kirill.shutemov@linux.intel.com>
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 5b701b846aad7909d20693bcced2522d0ce8d1bc)
Signed-off-by: Dan Duval <dan.duval@oracle.com>
mm/huge_memory.c

index 9f9a536465900dab783cf25e39c131bff519d66f..116e8fce6050bcbd76208f34f6e801ee5f6771bd 100644 (file)
@@ -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 {