DAMON development mailing list
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Aveline Noir" <jm5905938@gmail.com>, "SJ Park" <sj@kernel.org>,
	"Andrew Morton" <akpm@linux-foundation.org>
Cc: damon@lists.linux.dev, linux-mm@kvack.org
Subject: Re: [PATCH RFC] mm/damon/core: preserve region age differences during merging
Date: Mon, 30 Nov 2026 13:08:37 +0000	[thread overview]
Message-ID: <sashiko-outbox-241159@kernel.org> (raw)
In-Reply-To: <20261130-damon-preserve-region-age-v1-1-8701093ad356@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] mm/damon/core: raw nr_accesses check in
  damon_merge_regions_of()
--

commit 31ad98d8e8cfd0d1ff1566fceab291b4a0aa0418
Author: Aveline Noir <jm5905938@gmail.com>

mm/damon/core: preserve region age differences during merging

This commit skips merging adjacent regions on the first merge pass in
damon_merge_regions_of() if either region has no accesses and their age
difference exceeds both 10 aggregation intervals and the younger region's
age.

> diff --git a/mm/damon/core.c b/mm/damon/core.c
> index b791a2621bd62..70545b3e16ff3 100644
> --- a/mm/damon/core.c
> +++ b/mm/damon/core.c
> @@ -3745,6 +3745,11 @@ static void damon_merge_regions_of(struct damon_target *t, unsigned int thres,
>  			goto set_prev_continue;
>  		if (damon_sz_region(prev) + damon_sz_region(r) > sz_limit)
>  			goto set_prev_continue;
> +		/* Preserve age differences for DAMOS on the first pass. */
> +		if (count_age && (!r->nr_accesses || !prev->nr_accesses) &&
> +		    abs_diff(prev->age, r->age) >
> +		    max(10U, min(prev->age, r->age)))
> +			goto set_prev_continue;

[Severity: Medium]
Should this check score and damon_merge_score(prev, false, ctx,
use_probe_hits) instead of r->nr_accesses and prev->nr_accesses?

When damon_has_probe_weights(ctx) is true, kdamond_fn() skips
ctx->ops.check_accesses(ctx) and leaves nr_accesses at 0 for all regions.
As a result, (!r->nr_accesses || !prev->nr_accesses) is always true when
probe weights are configured, preventing adjacent actively accessed
regions with non-zero probe-hit scores from merging whenever their ages
differ.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261130-damon-preserve-region-age-v1-1-8701093ad356@gmail.com?part=1

      reply	other threads:[~2026-11-30 13:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 12:25 [PATCH RFC] mm/damon/core: preserve region age differences during merging Aveline Noir
2026-11-30 13:08 ` 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=sashiko-outbox-241159@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=jm5905938@gmail.com \
    --cc=linux-mm@kvack.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox