All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "SJ Park" <sj@kernel.org>
Cc: damon@lists.linux.dev
Subject: Re: [PATCH 6.18.y] mm/damon/ops-common: use nr_accesses moving sum for quota score
Date: Wed, 09 Sep 2026 05:17:14 +0000	[thread overview]
Message-ID: <20260909051715.3DB8B1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260909050521.225965-1-sj@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The commit message claims to fix the issue by using a new helper function `damon_nr_accesses_mvsum()`, but this function is never defined or called.
--

commit 3c964119e352fe243aaf217b238b33be4fa99148
Author: SJ Park <sj@kernel.org>

mm/damon/ops-common: use nr_accesses moving sum for quota score

Since commit 42f994b71404 ("mm/damon/core: implement scheme-specific apply
interval"), DAMOS scheme can be applied at any time.  At that time,
nr_accesses may not be fully aggregated.  But the quota prioritization
score is calculated using the not fully aggregated count.  As a result,
the performance of DAMOS could be degraded.  Fix by using
damon_nr_accesses_mvsum() instead.

Link: https://lore.kernel.org/20260719161136.90191-1-sj@kernel.org

> diff --git a/mm/damon/ops-common.c b/mm/damon/ops-common.c
> index ceaa2a6e1c9a3..929aab600c745 100644
> --- a/mm/damon/ops-common.c
> +++ b/mm/damon/ops-common.c
> @@ -101,8 +101,9 @@ int damon_hot_score(struct damon_ctx *c, struct damon_region *r,
>  	unsigned int age_weight = s->quota.weight_age;
>  	int hotness;
>  
> -	freq_subscore = r->nr_accesses * DAMON_MAX_SUBSCORE /
> -		damon_max_nr_accesses(&c->attrs);
> +	freq_subscore = mult_frac(r->nr_accesses_bp / 10000,
> +			DAMON_MAX_SUBSCORE,
> +			damon_max_nr_accesses(&c->attrs));

[Severity: Medium]
The commit message claims to fix the issue by using a new helper function
damon_nr_accesses_mvsum(), but this function is never defined or called.

Instead, the implementation in damon_hot_score() manually inlines the moving
sum calculation (r->nr_accesses_bp / 10000).

Is there a missing patch that adds damon_nr_accesses_mvsum(), or should the
commit message be updated to match the inline calculation?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260909050521.225965-1-sj@kernel.org?part=1

      reply	other threads:[~2026-09-09  5:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2026090846-defendant-neglector-22c4@gregkh>
2026-09-09  5:05 ` [PATCH 6.18.y] mm/damon/ops-common: use nr_accesses moving sum for quota score SJ Park
2026-09-09  5:17   ` sashiko-bot [this message]

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=20260909051715.3DB8B1F00A3A@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.