Skip to content

Commit b4216a5

Browse files
author
Audra Mitchell
committed
mm/damon/lru_sort: reset enabled when DAMON start failed
JIRA: https://issues.redhat.com/browse/RHEL-104908 This patch is a backport of the following upstream commit: commit b91b82e Author: SeongJae Park <sj@kernel.org> Date: Sun Jul 6 12:32:06 2025 -0700 mm/damon/lru_sort: reset enabled when DAMON start failed When the startup fails, 'enabled' parameter is not reset. As a result, users show the parameter 'Y' while it is not really working. Fix it by resetting 'enabled' to 'false' when the work is failed. Link: https://lkml.kernel.org/r/20250706193207.39810-6-sj@kernel.org Fixes: 7a034fb ("mm/damon/lru_sort: enable and disable synchronously") Signed-off-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Audra Mitchell <audra@redhat.com>
1 parent 4f8c340 commit b4216a5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mm/damon/lru_sort.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ static int __init damon_lru_sort_init(void)
335335
int err = damon_modules_new_paddr_ctx_target(&ctx, &target);
336336

337337
if (err)
338-
return err;
338+
goto out;
339339

340340
ctx->callback.after_wmarks_check = damon_lru_sort_after_wmarks_check;
341341
ctx->callback.after_aggregation = damon_lru_sort_after_aggregation;
@@ -344,6 +344,9 @@ static int __init damon_lru_sort_init(void)
344344
if (enabled)
345345
err = damon_lru_sort_turn(true);
346346

347+
out:
348+
if (err && enabled)
349+
enabled = false;
347350
return err;
348351
}
349352

0 commit comments

Comments
 (0)