[RFC PATCH 4/6] mm/damon/vaddr: impleement eligible_report() callback
From: SeongJae Park
Date: Sun Jun 29 2025 - 16:15:31 EST
For [f]vaddr DAMON ops, access reports for virtual address space of a
process that different from that for a given DAMON target shouldn't be
used. Implement an eligible_report() callback for [f]vaddr that does
the check.
Signed-off-by: SeongJae Park <sj@xxxxxxxxxx>
---
mm/damon/vaddr.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
index 46554e49a478..9970f95585ed 100644
--- a/mm/damon/vaddr.c
+++ b/mm/damon/vaddr.c
@@ -610,6 +610,12 @@ static unsigned int damon_va_check_accesses(struct damon_ctx *ctx)
return max_nr_accesses;
}
+static bool damon_va_eligible_report(struct damon_access_report *report,
+ struct damon_target *t)
+{
+ return report->pid == t->pid;
+}
+
/*
* Functions for the target validity check and cleanup
*/
@@ -710,6 +716,7 @@ static int __init damon_va_initcall(void)
.update = damon_va_update,
.prepare_access_checks = damon_va_prepare_access_checks,
.check_accesses = damon_va_check_accesses,
+ .eligible_report = damon_va_eligible_report,
.target_valid = damon_va_target_valid,
.cleanup = NULL,
.apply_scheme = damon_va_apply_scheme,
--
2.39.5