Skip to content

Commit

Permalink
mm/damon/core: copy nr_accesses when splitting region
Browse files Browse the repository at this point in the history
commit 1f3730f upstream.

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/[email protected]
Fixes: 42f994b ("mm/damon/core: implement scheme-specific apply interval")
Signed-off-by: SeongJae Park <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
sjp38 authored and Avenger-285714 committed Nov 23, 2024
1 parent 711db4d commit 3b1f1db
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mm/damon/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,7 @@ static void damon_split_region_at(struct damon_target *t,

new->age = r->age;
new->last_nr_accesses = r->last_nr_accesses;
new->nr_accesses = r->nr_accesses;

damon_insert_region(new, r, damon_next_region(r), t);
}
Expand Down

0 comments on commit 3b1f1db

Please sign in to comment.