summaryrefslogtreecommitdiff
path: root/mm/damon/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/damon/core.c')
-rw-r--r--mm/damon/core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 0ed97b21cbb6..2f6785737902 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -103,6 +103,8 @@ struct damos *damon_new_scheme(
scheme->min_age_region = min_age_region;
scheme->max_age_region = max_age_region;
scheme->action = action;
+ scheme->stat_count = 0;
+ scheme->stat_sz = 0;
INIT_LIST_HEAD(&scheme->list);
return scheme;
@@ -544,9 +546,12 @@ static void damon_do_apply_schemes(struct damon_ctx *c,
continue;
if (r->age < s->min_age_region || s->max_age_region < r->age)
continue;
+ s->stat_count++;
+ s->stat_sz += sz;
if (c->primitive.apply_scheme)
c->primitive.apply_scheme(c, t, r, s);
- r->age = 0;
+ if (s->action != DAMOS_STAT)
+ r->age = 0;
}
}