Re: [PATCH v2 1/2] mm/damon/core: keep the temporal tuner quota over an unmeasured PSI round

From: SJ Park

Date: Mon Sep 21 2026 - 12:38:45 EST


On Mon, 21 Sep 2026 04:00:12 +0200 Karl Mehltretter <kmehltretter@xxxxxxxxx> wrote:

> Commit b73198a47ffe ("mm/damon/core: handle uninitialized
> damos_quota_goal->last_psi_total") scores a PSI quota goal without a
> previous sample as achieved. This leaves the consist tuner's input
> unchanged, but the temporal tuner sets its quota to zero for an achieved
> goal. A running scheme with a nonzero temporal quota therefore loses a
> charge window after a quota-goal commit.
>
> Use the effective quota to preserve the temporal tuner's previous
> goal-achievement state during an unmeasured round, as SJ suggested [1].
> Score the goal as achieved when the effective quota is zero and as not
> achieved otherwise. A new scheme's initially zero quota stays zero, and
> the consist tuner's behavior is unchanged.
>
> Move the PSI current-value calculation and last_psi_total update into a
> helper that takes the current PSI total. This lets a unit test cover the
> unmeasured and measured rounds without depending on system memory
> pressure.

Looks good to me.

>
> Fixes: b73198a47ffe ("mm/damon/core: handle uninitialized damos_quota_goal->last_psi_total")
> Cc: <stable@xxxxxxxxxxxxxxx> # 7.1.x

The broken commit (b73198a47ffe) is not in the mainline but mm-unstable. We
should squash this to the broken commit before it is merged into the mainline.
Or, maybe pointing the original broken fix (2dbb60f789cb) as 'Fixes:' is
another option.

Do you have a preferrence?

> Suggested-by: SJ Park <sj@xxxxxxxxxx>
> Link: https://lore.kernel.org/damon/20260916001311.101024-1-sj@xxxxxxxxxx/ [1]
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>

Other than the above,

Reviewed-by: SJ Park <sj@xxxxxxxxxx>


Thanks,
SJ

[...]