[PATCH v2 04/10] mm/damon/paddr: support damos_filter->allow

From: SeongJae Park
Date: Thu Jan 09 2025 - 12:52:26 EST


Respect damos_filter->allow from 'paddr', which is a DAMON operations
set implementation for the physical address space and supports a few
types of region-internal DAMOS filters (anon, memcg and young). The
change is similar to that of the previous commit for core layer update.

Signed-off-by: SeongJae Park <sj@xxxxxxxxxx>
---
mm/damon/paddr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
index b0c283808ba6..817acfd4f8a2 100644
--- a/mm/damon/paddr.c
+++ b/mm/damon/paddr.c
@@ -198,7 +198,7 @@ static unsigned int damon_pa_check_accesses(struct damon_ctx *ctx)
return max_nr_accesses;
}

-static bool __damos_pa_filter_out(struct damos_filter *filter,
+static bool damos_pa_filter_match(struct damos_filter *filter,
struct folio *folio)
{
bool matched = false;
@@ -237,8 +237,8 @@ static bool damos_pa_filter_out(struct damos *scheme, struct folio *folio)
struct damos_filter *filter;

damos_for_each_filter(filter, scheme) {
- if (__damos_pa_filter_out(filter, folio))
- return true;
+ if (damos_pa_filter_match(filter, folio))
+ return !filter->allow;
}
return false;
}
--
2.39.5