diff options
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r-- | mm/huge_memory.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 915809b16edf..39d7df40c067 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c | |||
@@ -1632,7 +1632,8 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma, | |||
1632 | VM_BUG_ON(PageLRU(page)); | 1632 | VM_BUG_ON(PageLRU(page)); |
1633 | 1633 | ||
1634 | /* If there is no mapped pte young don't collapse the page */ | 1634 | /* If there is no mapped pte young don't collapse the page */ |
1635 | if (pte_young(pteval)) | 1635 | if (pte_young(pteval) || PageReferenced(page) || |
1636 | mmu_notifier_test_young(vma->vm_mm, address)) | ||
1636 | referenced = 1; | 1637 | referenced = 1; |
1637 | } | 1638 | } |
1638 | if (unlikely(!referenced)) | 1639 | if (unlikely(!referenced)) |
@@ -1892,7 +1893,8 @@ static int khugepaged_scan_pmd(struct mm_struct *mm, | |||
1892 | /* cannot use mapcount: can't collapse if there's a gup pin */ | 1893 | /* cannot use mapcount: can't collapse if there's a gup pin */ |
1893 | if (page_count(page) != 1) | 1894 | if (page_count(page) != 1) |
1894 | goto out_unmap; | 1895 | goto out_unmap; |
1895 | if (pte_young(pteval)) | 1896 | if (pte_young(pteval) || PageReferenced(page) || |
1897 | mmu_notifier_test_young(vma->vm_mm, address)) | ||
1896 | referenced = 1; | 1898 | referenced = 1; |
1897 | } | 1899 | } |
1898 | if (referenced) | 1900 | if (referenced) |