Re: [PATCH v1 1/2] mm/damon/core: prevent size quota overflow in the temporal goal tuner

From: Donggeun Yoo

Date: Sat Sep 19 2026 - 22:38:50 EST


Hi SJ,

Thank you for the review, and for pointing me at addr_unit -- I did not
know about it.

On Sat, 19 Sep 2026 09:55:08 -0700 SJ Park <sj@xxxxxxxxxx> wrote:
> For 32-bit machines, we have addr_unit parameter. I believe use of it could
> effectively solve this kind of issues. Correct me if I'm wrong.

You are right that it helps, and quite a lot: with a larger unit the same
amount of memory is written to quotas/bytes as a smaller number, so the
boundary is much harder to reach in practice. It does not move the
boundary itself, though, since the multiply is on the value written
whatever the unit means. And as you say, only paddr implements addr_unit,
so vaddr and fvaddr get nothing from it.

The 64-bit case turned out to be a little more than theoretical too.
bytes_store() takes whatever kstrtoul() parses, so a quotas/bytes above
1844674407370955 wraps there with no scaling involved.

v2 says both in the changelog, and your suggestion about the user
documents became a third patch. I also took your form of the guard; it is
a one-line diff and it reads better.

https://lore.kernel.org/damon/20260920023111.2466265-1-donggeunyoo.kernel@xxxxxxxxx/

Thanks,
Donggeun