summaryrefslogtreecommitdiffstats
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2015-09-08 14:59:28 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-09-08 15:35:28 -0700
commit5b701b846aad7909d20693bcced2522d0ce8d1bc (patch)
treed3cf24a5345a513cf95eeb412d1863c18266d13b /mm/huge_memory.c
parent843172978bb92997310d2f7fbc172ece423cfc02 (diff)
downloadblackbird-op-linux-5b701b846aad7909d20693bcced2522d0ce8d1bc.tar.gz
blackbird-op-linux-5b701b846aad7909d20693bcced2522d0ce8d1bc.zip
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 <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>
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r--mm/huge_memory.c4
1 files changed, 3 insertions, 1 deletions
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 {
OpenPOWER on IntegriCloud