Re: [PATCH] mm/damon: align MMU notifier range when clearing PMD young bit
From: SJ Park
Date: Thu Oct 22 2026 - 20:20:36 EST
Hello Aveline,
'hkml patch check' [1] says you forgot Cc-ing below people who are recommended
by get_maintainer.pl. I Cc-ed them. Please Cc all recipients who
get_maitnainer.pl is recommending, from the next time. 'hkml patch format' [2]
could also help you doing so.
- Fernand Sieber <sieberf@xxxxxxxxxx>
- Leonard Foerster <foersleo@xxxxxxxxx>
- SeongJae Park <sjpark@xxxxxxxxx>
- Shakeel Butt <shakeel.butt@xxxxxxxxx>
On Thu, 22 Oct 2026 22:26:08 +0800 Aveline Noir <jm5905938@xxxxxxxxx> wrote:
> damon_pmdp_mkold() clears the young bit of a PMD but notifies
> [addr, addr + HPAGE_PMD_SIZE), where addr can be an unaligned sampling
> address. This can miss part of the sampled huge page and age secondary
> mappings in the next one.
>
> Align addr to HPAGE_PMD_MASK so both operations cover the same huge page.
Looks good to me. Thank you for fixing.
>
> Fixes: 3f49584b262c ("mm/damon: implement primitives for the virtual memory address spaces")
This is an improvement of monitoring accuracy that DAMON provide only best
effort. So not Cc-ing stable@ makes sense to me.
> Link: https://lore.kernel.org/r/20261021-damon-align-pte-young-notifier-v1-1-d0365ac45b66@xxxxxxxxxx/
The is a link to Shubhang's pte_mkold() patch. When you add Link: to your
patch, please add a context on the commit message, from the next time.
I assume you added this link because you mentioned you will send this patch on
the thread, with your nice review of the patch. However, I think this patch
explains its context very well, and therefore this link is not needed.
> Signed-off-by: Aveline Noir <jm5905938@xxxxxxxxx>
Reviewed-by: SJ Park <sj@xxxxxxxxxx>
I applied this patch to damon/next [3] tree after dropping the Link: tag. We
are now in the middle of the merge window. It may be better to give mm.git
maintainer (Andrew Morton) time to work on pull request, rather than adding
more changes that are not really urgent. I understand this series is not
really urgent. Hence, Andrew might not add this patch until next -rc1 release.
In the case, I will request adding this to mm.git after next -rc1 release. Let
me know if you think this is really urgent or the Link: tag should be kept. If
not, no action from your side is needed for now.
> ---
> Tested both aligned and unaligned addresses on 2 MiB THPs in an x86-64 KVM
> guest with a recording MMU notifier; all ranges matched the sampled PMD.
Thank you for doing the test and sharing the results. Were you also able to
confirm the expected wrong behavior (missing part of the sampled huge page and
age secondary mapping), too?
[1] https://github.com/sjp38/hackermail/blob/master/USAGE.md#checking-patches
[2] https://github.com/sjp38/hackermail/blob/master/USAGE.md#formatting-patches
[3] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees
Thanks,
SJ
[...]