From: Karl Mehltretter <kmehltretter@gmail.com>
To: SJ Park <sj@kernel.org>
Cc: Karl Mehltretter <kmehltretter@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Lian Wang <lianux.mm@gmail.com>,
Kunwu Chan <kunwu.chan@gmail.com>,
damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] mm/damon/core: score an unmeasured PSI goal as not achieved for the temporal tuner
Date: Tue, 15 Sep 2026 08:09:36 +0200 [thread overview]
Message-ID: <20260915060937.3423-2-kmehltretter@gmail.com> (raw)
In-Reply-To: <20260915060937.3423-1-kmehltretter@gmail.com>
A newly created or committed PSI quota goal has no previous sample.
Commit a68878f83ae6 ("mm/damon/core: handle uninitialized
damos_quota_goal->last_psi_total") scores the first tuning round as
achieved to preserve the consist tuner's quota, since the feedback
loop returns its input unchanged at that score.
The temporal tuner sets the quota to zero for an achieved goal. This
skips the first charge window and the window after each goal commit.
Committing the PSI goal before every tuning round keeps the scheme
idle indefinitely.
Score an unmeasured PSI goal as not achieved for the temporal tuner,
so a new scheme can run in its first window. Keep the consist tuner's
behaviour unchanged.
Fixes: a68878f83ae6 ("mm/damon/core: handle uninitialized damos_quota_goal->last_psi_total")
Cc: <stable@vger.kernel.org> # 7.1.x
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
mm/damon/core.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 06cf2ab7e97d..e6d87fd3992e 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -3161,12 +3161,18 @@ static void damos_set_quota_goal_current_value(struct damon_ctx *c,
break;
case DAMOS_QUOTA_SOME_MEM_PSI_US:
now_psi_total = damos_get_some_mem_psi_total();
- /* uninitialized last_psi_total; make no effect this round */
- if (goal->last_psi_total == U64_MAX)
- goal->current_value = goal->target_value;
- else
+ if (goal->last_psi_total == U64_MAX) {
+ /* uninitialized last_psi_total; make no effect this round */
+ if (s->quota.goal_tuner ==
+ DAMOS_QUOTA_GOAL_TUNER_TEMPORAL)
+ /* an achieved score would zero the temporal quota */
+ goal->current_value = 0;
+ else
+ goal->current_value = goal->target_value;
+ } else {
goal->current_value = now_psi_total -
goal->last_psi_total;
+ }
goal->last_psi_total = now_psi_total;
break;
case DAMOS_QUOTA_NODE_MEM_USED_BP:
--
2.53.0
next prev parent reply other threads:[~2026-09-15 6:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-15 6:09 [PATCH 0/2] mm/damon: fix zero quota for PSI goals under " Karl Mehltretter
2026-09-15 6:09 ` Karl Mehltretter [this message]
2026-09-15 14:50 ` [PATCH 1/2] mm/damon/core: score an unmeasured PSI goal as not achieved for " SJ Park
2026-09-15 21:19 ` Karl Mehltretter
2026-09-16 0:13 ` SJ Park
2026-09-15 6:09 ` [PATCH 2/2] mm/damon/tests/core-kunit: test PSI goal rounds under " Karl Mehltretter
2026-09-15 7:04 ` KunWu Chan
2026-09-15 21:31 ` Karl Mehltretter
2026-09-16 0:21 ` SJ Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260915060937.3423-2-kmehltretter@gmail.com \
--to=kmehltretter@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=kunwu.chan@gmail.com \
--cc=lianux.mm@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®