Skip to content

Commit 1f3730f

Browse files
sjp38akpm00
authored andcommitted
mm/damon/core: copy nr_accesses when splitting region
Regions split function ('damon_split_region_at()') is called at the beginning of an aggregation interval, and when DAMOS applying the actions and charging quota. Because 'nr_accesses' fields of all regions are reset at the beginning of each aggregation interval, and DAMOS was applying the action at the end of each aggregation interval, there was no need to copy the 'nr_accesses' field to the split-out region. However, commit 42f994b ("mm/damon/core: implement scheme-specific apply interval") made DAMOS applies action on its own timing interval. Hence, 'nr_accesses' should also copied to split-out regions, but the commit didn't. Fix it by copying it. Link: https://lkml.kernel.org/r/20231119171529.66863-1-sj@kernel.org Fixes: 42f994b ("mm/damon/core: implement scheme-specific apply interval") Signed-off-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 0263f92 commit 1f3730f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

mm/damon/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,7 @@ static void damon_split_region_at(struct damon_target *t,
12251225
new->age = r->age;
12261226
new->last_nr_accesses = r->last_nr_accesses;
12271227
new->nr_accesses_bp = r->nr_accesses_bp;
1228+
new->nr_accesses = r->nr_accesses;
12281229

12291230
damon_insert_region(new, r, damon_next_region(r), t);
12301231
}

0 commit comments

Comments
 (0)