]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mm/damon/ops-common: remove redudnant mmu notifier call in pmdp mkold
authorqinyu <qin.yuA@h3c.com>
Tue, 3 Feb 2026 09:54:00 +0000 (17:54 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 24 Mar 2026 21:38:25 +0000 (14:38 -0700)
Currently, mmu_notifier_clear_young() is called immediately after
pmdp_clear_young_notify(), which already calls mmu_notifier_clear_young()
internally.  This results in a redundant notifier call.

Replace pmdp_clear_young_notify() with the non-notify variant to avoid the
duplicate call and make the pmdp path consistent with the corresponding
ptep_mkold() code.

Link: https://lkml.kernel.org/r/20260203095400.2465255-1-qin.yuA@h3c.com
Signed-off-by: qinyu <qin.yuA@h3c.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/ops-common.c

index a218d992223424a48b0adeb6349aeba5cfdd752d..8c6d613425c1314d4d1825ad7661388290d669d3 100644 (file)
@@ -90,7 +90,7 @@ void damon_pmdp_mkold(pmd_t *pmd, struct vm_area_struct *vma, unsigned long addr
                return;
 
        if (likely(pmd_present(pmdval)))
-               young |= pmdp_clear_young_notify(vma, addr, pmd);
+               young |= pmdp_test_and_clear_young(vma, addr, pmd);
        young |= mmu_notifier_clear_young(vma->vm_mm, addr, addr + HPAGE_PMD_SIZE);
        if (young)
                folio_set_young(folio);