Re: [RFC PATCH v2 2/7] mm/damon/core: extend probe_hits_wsum() for moving sum based calculation

From: SJ Park

Date: Mon Sep 07 2026 - 15:22:14 EST


On Mon, 7 Sep 2026 10:12:11 -0700 SJ Park <sj@xxxxxxxxxx> wrote:

> damon_probe_hits_wsum() is being called only in aggregation time. In
> future, it could also be used by DAMOS. In this case, since DAMOS uses
> its own apply_interval, it could be called in sampling time. Then using
> the not yet fully aggregated probe_hits could result in suboptimum
> outcomes. Extend damon_probe_hits_wsum() to get the weighted sum based
> on moving sum to prepare the DAMOS usage.
[...]
> --- a/mm/damon/vaddr.c
> +++ b/mm/damon/vaddr.c
> @@ -704,7 +704,7 @@ static unsigned int damon_va_apply_probes(struct damon_ctx *ctx,
> __damon_va_apply_probes(ctx, mm, r);
> if (return_max_wsum)
> max_wsum = max(damon_probe_hits_wsum(r, false,
> - ctx), max_wsum);
> + false, ctx), max_wsum);
> }
> if (mm)
> mmput(mm);

This cannot be applied on latest mm-new, because this relies on a
not-yet-merged patch series [1]. Hence Sashiko also failed [2] at reviewing
this series. I will post another RFC after rebasing to latest mm-new.

[1] https://lore.kernel.org/20260906184417.96621-1-sj@xxxxxxxxxx
[2] https://sashiko.dev/#/patchset/20260907171218.101430-1-sj%40kernel.org


Thanks,
SJ

[...]