Re: [PATCH v1 1/2] mm/damon/core: charge only the part of a region the filter left

From: SJ Park

Date: Wed Sep 16 2026 - 21:24:34 EST


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

> An address range DAMOS filter that partially overlaps a monitoring
> region splits the region at the filter boundary, so the scheme action is
> applied to only one side of it. damos_apply_scheme() reads the region
> size once on entry, before damos_core_filter_out() performs that split.
>
> The quota charge and the statistics update therefore account for the
> region as it was before the trim. schemes/<S>/stats/sz_tried counts
> memory the filter excluded, which Documentation/mm/damon/design.rst says
> is not counted as tried, and with quotas/bytes set the excluded part is
> charged against the budget, throttling the scheme to a fraction of what
> was configured.

The user impact is that DAMOS could work unexpectedly slow, due to over-charged
quota. Also DAMOS stat could be confusing. No critical events such as crashes
or leask happen.

If above is not incorrect, I will add that to the commit message when I add
this patch to damon/next tree. Let me know if anything is incorrect.

>
> Re-read the region size after the core filters have run.

Thank you for finding and fixing this bug!

>
> Fixes: ab9bda001b68 ("mm/damon/core: introduce address range type damos filter")
> Cc: <stable@xxxxxxxxxxxxxxx> # 6.6.x
> Signed-off-by: Donggeun Yoo <donggeunyoo.kernel@xxxxxxxxx>

Reviewed-by: SJ Park <sj@xxxxxxxxxx>


Thanks,
SJ

[...]