[RFC PATCH 07/19] mm/damon/core: do data attributes monitoring

SeongJae Park
2026-04-26T20:52:37Z

Implement the data attributes monitoring execution. Update kdamond to
invoke the probes application callback, and reset the aggregated number
of per-region per-probe positive samples for every aggregation interval.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
mm/damon/core.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/mm/damon/core.c b/mm/damon/core.c
index d4779b647a495..fe14971d72747 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -1921,10 +1921,14 @@ static void kdamond_reset_aggregated(struct damon_ctx *c)
struct damon_region *r;

damon_for_each_region(r, t) {
+ int i;
+
trace_damon_aggregated(ti, r, damon_nr_regions(t));
damon_warn_fix_nr_accesses_corruption(r);
r->last_nr_accesses = r->nr_accesses;
r->nr_accesses = 0;
+ for (i = 0; i < DAMON_MAX_PROBES; i++)
+ r->probe_hits[i] = 0;
damon_verify_reset_aggregated(r, c);
}
ti++;
@@ -3288,6 +3292,8 @@ static int kdamond_fn(void *data)

if (ctx->ops.check_accesses)
max_nr_accesses = ctx->ops.check_accesses(ctx);
+ if (ctx->ops.apply_probes)
+ ctx->ops.apply_probes(ctx);

if (time_after_eq(ctx->passed_sample_intervals,
next_aggregation_sis)) {
--
2.47.3