Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/damon/lru_sort: use damon_kdamond_pid()

DAMON_LRU_SORT directly uses damon_ctx->kdamond field with manual
synchronization using damon_ctx->kdamond_lock, to get the pid of the
kdamond. Use a new dedicated function for the purpose, namely
damon_kdamond_pid(), since that doesn't require manual and error-prone
synchronization.

Link: https://lkml.kernel.org/r/20260115152047.68415-4-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

SeongJae Park and committed by
Andrew Morton
306550f0 f54b51ce

+3 -1
+3 -1
mm/damon/lru_sort.c
··· 405 405 err = damon_start(&ctx, 1, true); 406 406 if (err) 407 407 return err; 408 - kdamond_pid = ctx->kdamond->pid; 408 + kdamond_pid = damon_kdamond_pid(ctx); 409 + if (kdamond_pid < 0) 410 + return kdamond_pid; 409 411 return damon_call(ctx, &call_control); 410 412 } 411 413