linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/damon/lru_sort: use param_ctx for damon_attrs staging
@ 2025-09-16  3:15 SeongJae Park
  0 siblings, 0 replies; only message in thread
From: SeongJae Park @ 2025-09-16  3:15 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, # 6 . 11 . x, damon, linux-kernel, linux-mm, Joshua Hahn

damon_lru_sort_apply_parameters() allocates a new DAMON context, stages
user-specified DAMON parameters on it, and commits to running DAMON
context at once, using damon_commit_ctx().  The code is, however,
directly updating the monitoring attributes of the running context.  And
the attributes are over-written by later damon_commit_ctx() call.  This
means that the monitoring attributes parameters are not really working.
Fix the wrong use of the parameter context.

Fixes: a30969436428 ("mm/damon/lru_sort: use damon_commit_ctx()")
Cc: <stable@vger.kernel.org> # 6.11.x
Signed-off-by: SeongJae Park <sj@kernel.org>
Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>
---
This was a part of misc fixes and improvements for 6.18 [1], but Joshua
thankfully found this is fixing a real user visible bug.  So sending this
separately as a hotfix.

[1] https://lore.kernel.org/20250915015807.101505-4-sj@kernel.org

 mm/damon/lru_sort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/damon/lru_sort.c b/mm/damon/lru_sort.c
index 14d31009c09e..ab6173a646bd 100644
--- a/mm/damon/lru_sort.c
+++ b/mm/damon/lru_sort.c
@@ -219,7 +219,7 @@ static int damon_lru_sort_apply_parameters(void)
 		goto out;
 	}
 
-	err = damon_set_attrs(ctx, &damon_lru_sort_mon_attrs);
+	err = damon_set_attrs(param_ctx, &damon_lru_sort_mon_attrs);
 	if (err)
 		goto out;
 

base-commit: ea93a9235c1c6e61cfa6e5612b7b6b3fc41e79e1
-- 
2.39.5


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

only message in thread, other threads:[~2025-09-16  3:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-16  3:15 [PATCH] mm/damon/lru_sort: use param_ctx for damon_attrs staging SeongJae Park

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