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

From: SJ Park

Date: Sun Nov 08 2026 - 14:17:49 EST


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. The
implementation is made on ops-common, so both vaddr and paddr gain the
support of the filter type.

Signed-off-by: SJ Park <sj@xxxxxxxxxx>
---
mm/damon/ops-common.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/mm/damon/ops-common.c b/mm/damon/ops-common.c
index b9571f53e538c..2216a0023154f 100644
--- a/mm/damon/ops-common.c
+++ b/mm/damon/ops-common.c
@@ -574,6 +574,13 @@ bool damon_ops_filter_match(struct damon_filter *filter, struct folio *folio)
matched = filter->range_min <= folio_sz &&
folio_sz <= filter->range_max;
break;
+ case DAMON_FILTER_TYPE_ACTIVE:
+ if (!folio) {
+ matched = false;
+ break;
+ }
+ matched = folio_test_active(folio);
+ break;
default:
break;
}
--
2.47.3