Re: [PATCH] mm/damon: use damon_get_monitor_folio() for hugetlb entries

From: SJ Park

Date: Fri Oct 02 2026 - 14:12:11 EST


Hello Gregory,

On Fri, 2 Oct 2026 10:07:27 -0400 "Gregory Price (Meta)" <gourry@xxxxxxxxxx> wrote:

> From: Gregory Price <gourry@xxxxxxxxxx>
>
> Hugetlb folio acquisition is open-coded in three places:
> - damon_hugetlb_mkold()
> - damon_young_hugetlb_entry()
> - damon_va_probe_hugetlb_entry()
>
> DAMON already has damon_get_monitor_folio(), which paddr uses to
> get monitored LRU and hugetlb folios and to filter them through
> damon_folio_acceptable(). These paths bypass that check.
>
> Use that helper in these paths too, so that DAMON acquires hugetlb
> folios and applies its acceptance policy in one place.
>
> No functional change intended. All callers reach these paths with a
> present hugetlb PTE under the page table lock, so the folio is always
> a mapped hugetlb folio and the helper always returns it.

Thank you for this patch, looks good to me!

>
> Signed-off-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>

Reviewed-by: SJ Park <sj@xxxxxxxxxx>


This patch is applied to damon/next [1] tree. If this patch is not added to
mm.git in short term (~1 week?), I will ask mm.git maintainer (Andrew Morton)
to pick this. So, no action from your side is needed for now. If it seems I
also forgot doing that or you cannot wait for my action, please feel free to
ping me or Andrew.

[1] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees


Thanks,
SJ

[...]