Re: [PATCH 2/4] mm/damon/ops-common: implement DAMON_FILTER_TYPE_ACTIVE operation

From: Aveline Noir

Date: Sat Dec 05 2026 - 12:17:47 EST


Hi SJ,

On Thu, 12 Nov 2026 21:17:08 -0800 SJ Park wrote:

> Implement DAMON_FILTER_TYPE_ACTIVE operation. Use folio_test_active()
> to show if the folio of the given memory is on an active LRU list.

Looks like this doesn't work with MGLRU, though. lru_gen_add_folio()
clears PG_active when it puts a folio on a generation list, so
folio_test_active() ends up false for pretty much every folio on the
LRU.

In a QEMU guest on mm-new with MGLRU on, the active probe never hit
while meminfo showed about 130 MiB of Active(anon). With lru_gen/enabled
set to 0, the probe saw roughly that amount. The existing DAMOS active
filter has the same issue.

Since some distros like Arch enable MGLRU by default, it might be worth
handling. Would checking lru_gen_is_active() for the folio's generation
make sense to you? Or maybe just a note in the doc, if that's simpler.

Thanks,
Aveline Noir