Skip to content

Commit ed1523a

Browse files
Baolin Wangakpm00
authored andcommitted
mm/damon: use set_huge_pte_at() to make huge pte old
The huge_ptep_set_access_flags() can not make the huge pte old according to the discussion [1], that means we will always mornitor the young state of the hugetlb though we stopped accessing the hugetlb, as a result DAMON will get inaccurate accessing statistics. So changing to use set_huge_pte_at() to make the huge pte old to fix this issue. [1] https://lore.kernel.org/all/[email protected]/ Link: https://lkml.kernel.org/r/[email protected] Fixes: 49f4203 ("mm/damon: add access checking for hugetlb pages") Signed-off-by: Baolin Wang <[email protected]> Reviewed-by: SeongJae Park <[email protected]> Acked-by: Mike Kravetz <[email protected]> Reviewed-by: Muchun Song <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent d684e0a commit ed1523a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mm/damon/vaddr.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,7 @@ static void damon_hugetlb_mkold(pte_t *pte, struct mm_struct *mm,
336336
if (pte_young(entry)) {
337337
referenced = true;
338338
entry = pte_mkold(entry);
339-
huge_ptep_set_access_flags(vma, addr, pte, entry,
340-
vma->vm_flags & VM_WRITE);
339+
set_huge_pte_at(mm, addr, pte, entry);
341340
}
342341

343342
#ifdef CONFIG_MMU_NOTIFIER

0 commit comments

Comments
 (0)