diff --git a/mm/damon/core.c b/mm/damon/core.c index 43e4fe7ef17e..48747236c21c 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1043,6 +1043,10 @@ static void damos_adjust_quota(struct damon_ctx *c, struct damos *s) if (!quota->ms && !quota->sz) return; + /* First charge window */ + if (!quota->total_charged_sz && !quota->charged_from) + quota->charged_from = jiffies; + /* New charge window starts */ if (time_after_eq(jiffies, quota->charged_from + msecs_to_jiffies(quota->reset_interval))) {