Linux Documentation
 help / color / mirror / Atom feed
From: SJ Park <sj@kernel.org>
To: SJ Park <sj@kernel.org>
Cc: stable@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>,
	Fernand Sieber <sieberf@amazon.com>,
	SeongJae Park <sjpark@amazon.de>,
	damon@lists.linux.dev, Jonathan Corbet <corbet@lwn.net>,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH 6.18.y] mm/damon/core: move static variable last_nr_regions to damon_ctx
Date: Mon,  9 Nov 2026 18:46:07 -0800	[thread overview]
Message-ID: <20261110024608.119184-1-sj@kernel.org> (raw)
In-Reply-To: <20261110022454.112647-1-sj@kernel.org>

On Mon,  9 Nov 2026 18:24:54 -0800 SJ Park <sj@kernel.org> wrote:

> kdamond_split_regions() uses a static variable last_nr_regions, to infer
> if the region boundaries are too stable.  If it looks too stable, it
> does a more aggressive region split because it might be a fake stability
> coming from non-aggressive split.  Because the variable is static, the
> inference can be racy and wrong when multiple kdamonds are running in
> parallel.
> 
> The user impact is not critical.  No crash, no leak.  DAMON's
> best-effort monitoring accuracy can be degraded when multiple kdamonds
> are used in parallel and the workload has certain access patterns. Still
> it is a bug that is better to fix.
> 
> Move the variable into the damon_ctx struct to fix the problem.
[...]
> --- a/include/linux/damon.h
> +++ b/include/linux/damon.h
> @@ -804,6 +804,11 @@ struct damon_ctx {
>  
>  	struct list_head adaptive_targets;
>  	struct list_head schemes;
> +	/*
> +	 * number of regions after last merge.  Read kdamond_split_regions()
> +	 * for more details.
> +	 */
> +	unsigned long last_nr_regions;

Sashiko warns [1] this could cause kernel-doc build warning.  I will post v2
after fixing the issue.

[1] https://lore.kernel.org/sashiko-outbox-206056@kernel.org


Thanks,
SJ

[...]

           reply	other threads:[~2026-11-10  2:46 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20261110022454.112647-1-sj@kernel.org>]

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=20261110024608.119184-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=damon@lists.linux.dev \
    --cc=linux-doc@vger.kernel.org \
    --cc=sieberf@amazon.com \
    --cc=sjpark@amazon.de \
    --cc=stable@vger.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