Skip to content

Commit

Permalink
mm: add missing mmu_notifier_clear_young for !MMU_NOTIFIER
Browse files Browse the repository at this point in the history
Remove the now unnecessary ifdef in mm/damon/vaddr.c as well.

Link: https://lkml.kernel.org/r/20241021160212.9935-1-jthoughton@google.com
Signed-off-by: James Houghton <jthoughton@google.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
  • Loading branch information
James Houghton authored and Andrew Morton committed Nov 7, 2024
1 parent 3f1f947 commit 628e1b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 7 additions & 0 deletions include/linux/mmu_notifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,13 @@ static inline int mmu_notifier_clear_flush_young(struct mm_struct *mm,
return 0;
}

static inline int mmu_notifier_clear_young(struct mm_struct *mm,
unsigned long start,
unsigned long end)
{
return 0;
}

static inline int mmu_notifier_test_young(struct mm_struct *mm,
unsigned long address)
{
Expand Down
2 changes: 0 additions & 2 deletions mm/damon/vaddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,9 @@ static void damon_hugetlb_mkold(pte_t *pte, struct mm_struct *mm,
set_huge_pte_at(mm, addr, pte, entry, psize);
}

#ifdef CONFIG_MMU_NOTIFIER
if (mmu_notifier_clear_young(mm, addr,
addr + huge_page_size(hstate_vma(vma))))
referenced = true;
#endif /* CONFIG_MMU_NOTIFIER */

if (referenced)
folio_set_young(folio);
Expand Down

0 comments on commit 628e1b8

Please sign in to comment.