[RFC PATCH v1.1 3/3] mm/damon/sysfs-schemes: set probe hits as pseudo moving sums
From: SJ Park
Date: Thu Jul 02 2026 - 14:16:40 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: SJ 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 dbf2b0515d582..32f495a96b17a 100644
--- a/mm/damon/sysfs-schemes.c
+++ b/mm/damon/sysfs-schemes.c
@@ -110,7 +110,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