From: SeongJae Park <sj@kernel.org>
To: sashiko-bot@kernel.org
Cc: SeongJae Park <sj@kernel.org>, damon@lists.linux.dev
Subject: Re: [RFC PATCH v1.3 01/11] Docs/mm/damon/design: update for DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP
Date: Thu, 25 Jun 2026 17:31:24 -0700 [thread overview]
Message-ID: <20260626003125.87513-1-sj@kernel.org> (raw)
In-Reply-To: <20260626002448.975E21F000E9@smtp.kernel.org>
On Fri, 26 Jun 2026 00:24:48 +0000 sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
>
> Pre-existing issues:
> - [High] Truncation of 64-bit phys_addr_t to 32-bit unsigned long in damos_get_node_eligible_mem_bp leads to incorrect metric calculation on 32-bit systems.
> --
>
> commit 569eb38d08bfaf4718faa6440d86cad7ba9478b7
> Author: SeongJae Park <sj@kernel.org>
>
> Docs/mm/damon/design: update for DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP
>
> Commit 9138e27a3bc3 introduced DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP but forgot
> updating the DAMON design document for that. This commit updates the
> documentation to include the missing metric.
>
> > diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst
> > --- a/Documentation/mm/damon/design.rst
> > +++ b/Documentation/mm/damon/design.rst
> > @@ -686,9 +686,11 @@ mechanism tries to make ``current_value`` of ``target_metric`` be same to
> > (1/10,000).
> > - ``inactive_mem_bp``: Inactive to active + inactive (LRU) memory size ratio in
> > bp (1/10,000).
> > +- ``node_eligible_mem_bp``: Scheme target access pattern-eligible memory ratio
> > + of a node in bp (1/10,000).
>
> [Severity: High]
> This isn't a bug introduced by this patch, but while reviewing this metric, I
> noticed a pre-existing issue in its implementation.
>
> In mm/damon/core.c:damos_get_node_eligible_mem_bp(), 64-bit phys_addr_t byte
> counts are cast to 32-bit unsigned long before ratio calculation:
>
> if (!(unsigned long)total_eligible)
> return 0;
>
> return mult_frac((unsigned long)node_eligible, 10000,
> (unsigned long)total_eligible);
>
> On 32-bit systems with PAE, if the amount of eligible memory exceeds 4GB,
> will this truncation cause the metric to calculate completely incorrect ratios
> (e.g., reporting > 10000 basis points) or erroneously return 0 due to modulo
> arithmetic?
>
> This could cause the DAMOS quota tuner to adjust quotas wrongly, potentially
> resulting in extremely aggressive or completely ineffective memory actions.
Known low priority issue. Not a blocker.
Thanks,
SJ
[...]
next prev parent reply other threads:[~2026-06-26 0:31 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 0:16 [RFC PATCH v1.3 00/11] mm/damon: update, optimize, and clean up doc, tests, and code SeongJae Park
2026-06-26 0:16 ` [RFC PATCH v1.3 01/11] Docs/mm/damon/design: update for DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP SeongJae Park
2026-06-26 0:24 ` sashiko-bot
2026-06-26 0:31 ` SeongJae Park [this message]
2026-06-26 0:16 ` [RFC PATCH v1.3 02/11] Docs/ABI/damon: document probe files SeongJae Park
2026-06-26 0:25 ` sashiko-bot
2026-06-26 0:34 ` SeongJae Park
2026-06-26 0:16 ` [RFC PATCH v1.3 03/11] mm/damon/tests/core-kunit: test damon_rand() SeongJae Park
2026-06-26 0:25 ` sashiko-bot
2026-06-26 0:39 ` SeongJae Park
2026-06-26 0:16 ` [RFC PATCH v1.3 04/11] selftests/damon/sysfs.sh: test multiple probe dirs creation SeongJae Park
2026-06-26 0:16 ` [RFC PATCH v1.3 05/11] selftests/damon/sysfs.sh: test {core,ops}_filters/ directories SeongJae Park
2026-06-26 0:16 ` [RFC PATCH v1.3 06/11] selftests/damon/sysfs.sh: test dests dir SeongJae Park
2026-06-26 0:16 ` [RFC PATCH v1.3 07/11] selftests/damon/sysfs.sh: test all files in quota goal dir SeongJae Park
2026-06-26 0:16 ` [RFC PATCH v1.3 08/11] mm/damon/core: reduce range setup in damon_commit_target_regions() SeongJae Park
2026-06-26 0:16 ` [RFC PATCH v1.3 09/11] mm/damon/sysfs: split probe setup function out SeongJae Park
2026-06-26 0:16 ` [RFC PATCH v1.3 10/11] mm/damon/sysfs: split out filters setup function SeongJae Park
2026-06-26 0:16 ` [RFC PATCH v1.3 11/11] mm/damon/sysfs: fix typos in probe_{add,rm}_dirs: s/attr/probe/ SeongJae 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=20260626003125.87513-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=damon@lists.linux.dev \
--cc=sashiko-bot@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