|
@@ -117,11 +117,14 @@ static pte_t get_clear_flush(struct mm_struct *mm,
|
|
|
|
|
|
/*
|
|
|
* If HW_AFDBM is enabled, then the HW could turn on
|
|
|
- * the dirty bit for any page in the set, so check
|
|
|
- * them all. All hugetlb entries are already young.
|
|
|
+ * the dirty or accessed bit for any page in the set,
|
|
|
+ * so check them all.
|
|
|
*/
|
|
|
if (pte_dirty(pte))
|
|
|
orig_pte = pte_mkdirty(orig_pte);
|
|
|
+
|
|
|
+ if (pte_young(pte))
|
|
|
+ orig_pte = pte_mkyoung(orig_pte);
|
|
|
}
|
|
|
|
|
|
if (valid) {
|
|
@@ -340,10 +343,13 @@ int huge_ptep_set_access_flags(struct vm_area_struct *vma,
|
|
|
if (!pte_same(orig_pte, pte))
|
|
|
changed = 1;
|
|
|
|
|
|
- /* Make sure we don't lose the dirty state */
|
|
|
+ /* Make sure we don't lose the dirty or young state */
|
|
|
if (pte_dirty(orig_pte))
|
|
|
pte = pte_mkdirty(pte);
|
|
|
|
|
|
+ if (pte_young(orig_pte))
|
|
|
+ pte = pte_mkyoung(pte);
|
|
|
+
|
|
|
hugeprot = pte_pgprot(pte);
|
|
|
for (i = 0; i < ncontig; i++, ptep++, addr += pgsize, pfn += dpfn)
|
|
|
set_pte_at(vma->vm_mm, addr, ptep, pfn_pte(pfn, hugeprot));
|