Re: [PATCH 1/2] mm/damon/core: score an unmeasured PSI goal as not achieved for the temporal tuner

From: Karl Mehltretter

Date: Sat Sep 19 2026 - 01:44:23 EST


On Tue, Sep 15, 2026 at 05:13:11PM +0100, SJ Park wrote:
> So I'd still prefer to just making no effect this round. And my commit was
> failed at doing that, because it didn't aware of temporal tuner. Maybe we
> could show whether the goal was achieved or not, using esz and let the tuner
> show same achieveness? What about something like below?
>

Thanks for explaining the two concerns. I am still new to the DAMON
code, so I may be missing something, but your suggestion looks good
to me and it is simpler than what I had. I have prepared a v2 this
way and will wait for your comments before I send it.

One note on the first concern: as far as I can see last_psi_total is
updated in every tuning round, so commits in between would not make
the measured time longer than the reset interval. But I am fine with
your approach either way.

I would also move the last_psi_total update into the new helper, so
that the helper is the only place that touches the field and the
unit test can check it.

While testing this with damo I found a second problem. A full
"damo tune" still gave a zero quota for one window, on the unpatched
kernel too. damon_new_scheme() runs damos_quota_init() on the quota
of the caller, and since b90408ef1163 damon_commit_ctx() passes the
quota of each running scheme to it for the test context. So every
full commit zeroes esz, esz_bp and the charge state of the running
schemes. Please correct me if I read this wrong. I can send a
separate patch for that.

In a quick QEMU test with your suggestion and that change, the quota
stays at 1 MiB over "damo tune" and "damo tune --quota_goals_only".

Thanks,
Karl