From: qinyu <qin.yuA@h3c.com>
To: <sj@kernel.org>
Cc: <damon@lists.linux.dev>, <linux-mm@kvack.org>, qinyu <qin.yuA@h3c.com>
Subject: [PATCH] mm/damon: remove redudnant mmu notifier call in pmdp mkold
Date: Tue, 3 Feb 2026 17:54:00 +0800 [thread overview]
Message-ID: <20260203095400.2465255-1-qin.yuA@h3c.com> (raw)
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.
Signed-off-by: qinyu <qin.yuA@h3c.com>
---
mm/damon/ops-common.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/damon/ops-common.c b/mm/damon/ops-common.c
index a218d9922..8c6d61342 100644
--- a/mm/damon/ops-common.c
+++ b/mm/damon/ops-common.c
@@ -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);
--
2.33.0
next reply other threads:[~2026-02-03 9:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-03 9:54 qinyu [this message]
2026-02-03 16:22 ` SeongJae Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260203095400.2465255-1-qin.yuA@h3c.com \
--to=qin.yua@h3c.com \
--cc=damon@lists.linux.dev \
--cc=linux-mm@kvack.org \
--cc=sj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox