Skip to contentSkip to conversation

mm/damon/lru_sort: use param_ctx for damon_attrs staging

PATCH Applied SeongJae Park 1 participant 1 message Sep 16, 2025

Subsystems (3)
lore
Share & tools
lore

SeongJae Park

author maintainer
#0 lore raw

PATCH 1/1 mm/damon/lru_sort: use param_ctx for damon_attrs staging

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 <[email protected]> # 6.11.x

---
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/[email protected]

 mm/damon/lru_sort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/damon/lru_sort.c +1 -1
index 14d31009c09e..ab6173a646bd 100644
@@ -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

Signature · 1 line
2.39.5