From: sashiko-bot@kernel.org
To: "SJ Park" <sj@kernel.org>
Cc: damon@lists.linux.dev
Subject: Re: [PATCH] mm/damon/core: reset invalid quota->charge_target_from
Date: Mon, 07 Sep 2026 17:13:46 +0000 [thread overview]
Message-ID: <20260907171346.9A93F1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260907165529.98874-1-sj@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The newly added fix for invalid `charge_target_from` pointers is bypassed if a scheme's quota is dynamically disabled, leaving the scheme permanently broken.
--
commit f88287bb2670346a5987d086e0731c7ba6d0b19e
Author: SJ Park <sj@kernel.org>
mm/damon/core: reset invalid quota->charge_target_from
DAMOS can suddenly stop working if a target process that quota just
fully charged in it is terminated. Fix by catching and processing the
corner case.
> diff --git a/mm/damon/core.c b/mm/damon/core.c
> index ce8c6f99106ed..2c58be9edbde4 100644
> --- a/mm/damon/core.c
> +++ b/mm/damon/core.c
[ ... ]
> @@ -3318,6 +3334,8 @@ static void damos_adjust_quota(struct damon_ctx *c, struct damos *s)
> damos_trace_esz(c, s, quota);
> }
>
> + damos_reset_invalid_charge_target_from(quota, c);
> +
> if (!c->ops.get_scheme_score)
> return;
>
[Severity: High]
This is a pre-existing issue, but does this bypass the newly added reset if a
scheme's quota is dynamically disabled?
If a user hits the corner case where charge_target_from becomes invalid, and
then dynamically disables the scheme's quota via sysfs (setting ms=0 and
sz=0), damos_adjust_quota() will return early before the reset is reached:
mm/damon/core.c:damos_adjust_quota() {
if (!quota->ms && !quota->sz && list_empty("a->goals))
return;
...
}
Because damos_skip_charged_region() does not check if the quota is enabled
before evaluating charge_target_from, it will continue to skip all regions
forever:
mm/damon/core.c:damos_skip_charged_region() {
...
if (t != quota->charge_target_from)
return true;
...
}
Could the pointer reset be moved before the early return in
damos_adjust_quota(), or could the skipping logic be updated to handle
disabled quotas?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260907165529.98874-1-sj@kernel.org?part=1
next prev parent reply other threads:[~2026-09-07 17:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 16:55 [PATCH] mm/damon/core: reset invalid quota->charge_target_from SJ Park
2026-09-07 17:13 ` sashiko-bot [this message]
2026-09-07 17:27 ` SJ Park
2026-09-07 17:28 ` 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=20260907171346.9A93F1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=damon@lists.linux.dev \
--cc=sashiko-reviews@lists.linux.dev \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.