Re: [PATCH] mm/damon: align MMU notifier range when clearing PTE young bit
From: SJ Park
Date: Thu Oct 22 2026 - 10:09:14 EST
Hello Shubhang,
On Wed, 21 Oct 2026 23:36:19 -0700 "Shubhang Kaushik (Ampere)" <sh@xxxxxxxxxx> wrote:
> DAMON selects a byte-granular sampling address. damon_ptep_mkold()
> clears the young bit of the PTE covering that address, but passes the
> unaligned range [addr, addr + PAGE_SIZE) to MMU notifiers.
>
> For an unaligned address, that range extends into the following page.
> KVM ages every guest page intersecting the notifier range, so it can age
> a secondary mapping for the following page although DAMON cleared only
> the sampled page's primary PTE.
>
> Align the address before both the primary PTE operation and the
> MMU notifier call so that they cover the same page.
Thank you for finding and fixing this!
>
> Fixes: 3f49584b262c ("mm/damon: implement primitives for the virtual memory address spaces")
I once thought if we need to Cc: stable@. Because this is only for monitoring
accruacy improvement and DAMON is only beest-effort, I think we don't need to.
> Signed-off-by: Shubhang Kaushik (Ampere) <sh@xxxxxxxxxx>
Reviewed-by: SJ Park <sj@xxxxxxxxxx>
I applied this patch to damon/next [1] tree. We are now in the middle of the
merge window. It may better to focus on making mm.git changes pulled into the
mainline, 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. So, no action from your side is needed for
now. Let me know if you think this is really urgent.
[1] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees
Thanks,
SJ
[...]