Re: [PATCH v2] mm/damon/paddr: skip non-LRU folios as a whole in pageout

From: SJ Park

Date: Wed Nov 18 2026 - 09:34:33 EST


On Wed, 18 Nov 2026 03:24:28 +1100 Aveline Noir <jm5905938@xxxxxxxxx> wrote:

> damon_pa_pageout() uses damon_get_folio(), which rejects folios that are
> not on the LRU. For a large non-LRU folio such as a hugetlb folio, the
> loop then looks up the same folio once per base page even though
> pageout cannot reclaim it.
>
> Use damon_get_monitor_folio() and skip any returned non-LRU folio as a
> whole by advancing to its end. Do this before the filters, the
> accounting and the last_applied check, so that adjacent regions within
> the same non-LRU folio are not walked by base page either.
>
> In an x86-64 KVM pageout microbenchmark, traversal time dropped by
> about 99.7% for regions covering whole 2 MiB hugetlb folios. For
> 4 KiB regions within hugetlb folios, traversal took about 1 ns more
> per region.

Looks good to me.

>
> Signed-off-by: Aveline Noir <jm5905938@xxxxxxxxx>

Reviewed-by: SJ Park <sj@xxxxxxxxxx>

This patch is applied to damon/next [1] tree. I will repost it soon (~1 week)
as an mm.git merge request. So, no action from your side is needed for now.

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


Thanks,
SJ

[...]