mm/damon/sysfs-schemes: set probe hits as pseudo moving sums

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.

Link: https://lore.kernel.org/20260703170605.94472-4-sj@kernel.org
Signed-off-by: SJ Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
SJ Park 2026-07-03 10:06:03 -07:00 committed by Andrew Morton
parent 2ec26dd341
commit a9298dd669

View File

@ -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;