[PATCH v1 0/2] mm/damon/core: fix the size charged for a filter-trimmed region

Donggeun Yoo posted 2 patches 1 week, 1 day ago
There is a newer version of this series
mm/damon/core.c             |   1 +
mm/damon/tests/core-kunit.h | 316 ++++++++++++++++++++++++++++++++++++
2 files changed, 317 insertions(+)
[PATCH v1 0/2] mm/damon/core: fix the size charged for a filter-trimmed region
Posted by Donggeun Yoo 1 week, 1 day ago
An address range DAMOS filter that partially overlaps a monitoring region
splits it, so the scheme action reaches only one side of the boundary.
damos_apply_scheme() reads the region size before that split and never
re-reads it, so the quota charge and schemes/<S>/stats/sz_tried account for
the whole original region.

Patch 1 re-reads the size after the core filters have run.  Patch 2 adds
KUnit coverage for what the function charges and reports, for the trimmed
cases and for the cases that must not change.

Donggeun Yoo (2):
  mm/damon/core: charge only the part of a region the filter left
  mm/damon/tests/core-kunit: test the size charged for a filter-trimmed
    region

 mm/damon/core.c             |   1 +
 mm/damon/tests/core-kunit.h | 316 ++++++++++++++++++++++++++++++++++++
 2 files changed, 317 insertions(+)


base-commit: 892f5b3b07e5b07f2f29c87750ff94fa58dcab73
-- 
2.53.0
Re: [PATCH v1 0/2] mm/damon/core: fix the size charged for a filter-trimmed region
Posted by SJ Park 1 week, 1 day ago
Hello Donggeun,

On Thu, 17 Sep 2026 09:35:51 +0900 Donggeun Yoo <donggeunyoo.kernel@gmail.com> wrote:

> An address range DAMOS filter that partially overlaps a monitoring region
> splits it, so the scheme action reaches only one side of the boundary.
> damos_apply_scheme() reads the region size before that split and never
> re-reads it, so the quota charge and schemes/<S>/stats/sz_tried account for
> the whole original region.
> 
> Patch 1 re-reads the size after the core filters have run.  Patch 2 adds
> KUnit coverage for what the function charges and reports, for the trimmed
> cases and for the cases that must not change.

This series is applied to damon/next [1] tree.  If this patch is not added to
mm.git in short term (~1 week?), I will ask mm.git maintainer (Andrew Morton)
to pick this.  So, no action from your side is needed for now.  If it seems I
also forgot doing that or you cannot wait for my action, please feel free to
ping me or directly ask that to Andrew.

[1] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees


Thanks,
SJ

[...]