Linux Documentation
 help / color / mirror / Atom feed
* Re: [PATCH 6.18.y] mm/damon/core: move static variable last_nr_regions to damon_ctx
       [not found] <20261110022454.112647-1-sj@kernel.org>
@ 2026-11-10  2:46 ` SJ Park
  0 siblings, 0 replies; only message in thread
From: SJ Park @ 2026-11-10  2:46 UTC (permalink / raw)
  To: SJ Park
  Cc: stable, Andrew Morton, Fernand Sieber, SeongJae Park, damon,
	Jonathan Corbet, linux-doc

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

[...]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-10  2:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20261110022454.112647-1-sj@kernel.org>
2026-11-10  2:46 ` [PATCH 6.18.y] mm/damon/core: move static variable last_nr_regions to damon_ctx SJ Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox