Re: [PATCH v3 mm-unstable] mm/damon/core: keep the temporal tuner quota over an unmeasured PSI round
From: Andrew Morton
Date: Thu Sep 24 2026 - 16:14:05 EST
On Tue, 22 Sep 2026 22:51:37 -0700 SJ Park <sj@xxxxxxxxxx> wrote:
> From: Karl Mehltretter <kmehltretter@xxxxxxxxx>
>
> The patch in mm-unstable of subject "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.
>
> ...
>
> This is a fixup of a patch [1] that is still in mm-unstable tree.
>
> [1] https://lore.kernel.org/20260902002725.108635-3-sj@xxxxxxxxxx
thanks, I'll queue this as a squashable fix against "mm/damon/core:
handle uninitialized damos_quota_goal->last_psi_total".
Which means I locally named it
mm-damon-core-handle-uninitialized-damos_quota_goal-last_psi_total-fix.patch
and shall squash it in before moving things into mm-stable. Karl's
contribution will be captured in a footer note and a Signed-off-by:.