Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm/damon/core: preserve deadlines when tuned intervals are unchanged
@ 2026-12-03 17:47 Aveline Noir
  2026-12-04  7:57 ` Enze Li
  2026-12-04 15:25 ` SJ Park
  0 siblings, 2 replies; 3+ messages in thread
From: Aveline Noir @ 2026-12-03 17:47 UTC (permalink / raw)
  To: SJ Park; +Cc: linux-kernel, Andrew Morton, damon, linux-mm

kdamond_tune_intervals() calls damon_set_attrs() even when clamping or
rounding leaves the sampling and aggregation intervals unchanged. This
restarts the ops update and DAMOS apply deadlines. Repeated same-value
tuning can keep deferring longer update and apply intervals.

Return early when both intervals are unchanged.

Fixes: f04b0fedbe71 ("mm/damon/core: implement intervals auto-tuning")
Signed-off-by: Aveline Noir <jm5905938@gmail.com>
---
 mm/damon/core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/damon/core.c b/mm/damon/core.c
index 946b28440dff..b3283292c289 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -2429,6 +2429,9 @@ static noinline_for_stack void kdamond_tune_intervals(struct damon_ctx *c)
 	new_attrs.aggr_interval = new_attrs.sample_interval *
 		c->attrs.aggr_samples;
 	trace_damon_monitor_intervals_tune(new_attrs.sample_interval);
+	if (new_attrs.sample_interval == c->attrs.sample_interval &&
+			new_attrs.aggr_interval == c->attrs.aggr_interval)
+		return;
 	damon_set_attrs(c, &new_attrs);
 }
 

---
base-commit: 067c5c24cef23d913b67eaaf71ae67e7169a6620
change-id: 20261204-damon-preserve-tuning-deadlines-70ed8f2c77ef



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm/damon/core: preserve deadlines when tuned intervals are unchanged
  2026-12-03 17:47 [PATCH] mm/damon/core: preserve deadlines when tuned intervals are unchanged Aveline Noir
@ 2026-12-04  7:57 ` Enze Li
  2026-12-04 15:25 ` SJ Park
  1 sibling, 0 replies; 3+ messages in thread
From: Enze Li @ 2026-12-04  7:57 UTC (permalink / raw)
  To: Aveline Noir, SJ Park; +Cc: linux-kernel, Andrew Morton, damon, linux-mm

On 12/4/26 01:47, Aveline Noir wrote:
> kdamond_tune_intervals() calls damon_set_attrs() even when clamping or
> rounding leaves the sampling and aggregation intervals unchanged. This
> restarts the ops update and DAMOS apply deadlines. Repeated same-value
> tuning can keep deferring longer update and apply intervals.
> 
> Return early when both intervals are unchanged.
> 
> Fixes: f04b0fedbe71 ("mm/damon/core: implement intervals auto-tuning")
> Signed-off-by: Aveline Noir <jm5905938@gmail.com>

Thanks for finding and fixing this, Aveline.

Reviewed-by: Enze Li <lienze@kylinos.cn>

Thanks,
Enze


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm/damon/core: preserve deadlines when tuned intervals are unchanged
  2026-12-03 17:47 [PATCH] mm/damon/core: preserve deadlines when tuned intervals are unchanged Aveline Noir
  2026-12-04  7:57 ` Enze Li
@ 2026-12-04 15:25 ` SJ Park
  1 sibling, 0 replies; 3+ messages in thread
From: SJ Park @ 2026-12-04 15:25 UTC (permalink / raw)
  To: Aveline Noir; +Cc: SJ Park, linux-kernel, Andrew Morton, damon, linux-mm

On Fri, 04 Dec 2026 04:47:59 +1100 Aveline Noir <jm5905938@gmail.com> wrote:

> kdamond_tune_intervals() calls damon_set_attrs() even when clamping or
> rounding leaves the sampling and aggregation intervals unchanged. This
> restarts the ops update and DAMOS apply deadlines. Repeated same-value
> tuning can keep deferring longer update and apply intervals.
> 
> Return early when both intervals are unchanged.

Makes sense to me.

> 
> Fixes: f04b0fedbe71 ("mm/damon/core: implement intervals auto-tuning")
> Signed-off-by: Aveline Noir <jm5905938@gmail.com>

Reviewed-by: SJ Park <sj@kernel.org>

This patch is applied to damon/next [1] tree.  I will repost it soon (~1 week)
as an mm.git merge request.  So, no action from your side is needed for now.

[1] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html#scm-trees


Thanks,
SJ

[...]


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-04 15:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 17:47 [PATCH] mm/damon/core: preserve deadlines when tuned intervals are unchanged Aveline Noir
2026-12-04  7:57 ` Enze Li
2026-12-04 15:25 ` SJ Park

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