[RFC PATCH 3/3] mm/damon/sysfs-schemes: set probe hits as pseudo moving sums

From: SeongJae Park

Date: Sun Jun 21 2026 - 17:43:05 EST


DAMON sysfs interface exposes damon_region->probe_hits via probe hit
files. Because the counters are completed only at the end of the
aggregation interval, users can show incomplete values if they requested
the file content update (update_schemes_tried_regions command) in the
middle of an aggregation interval. Set the value as the pseudo moving
sum value of the counter, similar to that for nr_accesses.

Signed-off-by: SeongJae Park <sj@xxxxxxxxxx>
---
mm/damon/sysfs-schemes.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c
index 30a007bcf82f4..06ebf381c32b6 100644
--- a/mm/damon/sysfs-schemes.c
+++ b/mm/damon/sysfs-schemes.c
@@ -112,7 +112,8 @@ static int damos_sysfs_probes_add_dirs(struct damos_sysfs_probes *probes,
struct damos_sysfs_probe *sys_probe;
int err;

- sys_probe = damos_sysfs_probe_alloc(region->probe_hits[i]);
+ sys_probe = damos_sysfs_probe_alloc(
+ damon_probe_hits_mvsum(i, region, ctx));
if (!sys_probe) {
damos_sysfs_probes_rm_dirs(probes);
return -ENOMEM;
--
2.47.3