[PATCH 0/2] mm/damon: fix zero quota for PSI goals under the temporal tuner
From: Karl Mehltretter
Date: Tue Sep 15 2026 - 02:10:30 EST
A PSI quota goal without a previous sample is scored as achieved.
With the temporal tuner, this sets the quota to zero for the first
charge window and the window after each goal commit.
The series is based on next-20260911. It fixes commit a68878f83ae6
("mm/damon/core: handle uninitialized damos_quota_goal->last_psi_total"),
which is in mm-new and tagged for stable. Please carry this fix with
it.
Patch 1 keeps the temporal quota active until a PSI delta is
available. Patch 2 adds a regression test for the first round, the
next measured round, the round after a goal commit, a measured round
that reaches the target, and the consist tuner's unmeasured round.
Reproduced with damo 3.4.0 (b41965a) in a QEMU guest running
next-20260911 (x86_64, CONFIG_DAMON_SYSFS=y, CONFIG_PSI=y):
damo start --damos_action stat --damos_quota_interval 120000 \
--damos_quota_space 1048576 \
--damos_quota_goal some_mem_psi_us 100000000000 \
--damos_quota_goal_tuner temporal
then reading quotas/effective_bytes after update_schemes_effective_quotas
every 18 seconds. Without patch 1 the effective quota is 0 for the whole
first 120 second window and again for the window after "damo tune" with
the same parameters. With patch 1 it is 1048576 throughout.
The KUnit test in patch 2 fails without patch 1 and passes with it on
x86_64 and i386 (CONFIG_DAMON_KUNIT_TEST=y, built-in KUnit run at boot).
Karl Mehltretter (2):
mm/damon/core: score an unmeasured PSI goal as not achieved for the
temporal tuner
mm/damon/tests/core-kunit: test PSI goal rounds under the temporal
tuner
mm/damon/core.c | 14 +++++---
mm/damon/tests/core-kunit.h | 69 +++++++++++++++++++++++++++++++++++++
2 files changed, 79 insertions(+), 4 deletions(-)
base-commit: 68142f986ff04b2b70b31db00f719bf690f64a9a
--
2.53.0