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/reclaim: use damon_kdamond_pid()

DAMON_RECLAIM 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-5-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
33402229 306550f0

+3 -1
+3 -1
mm/damon/reclaim.c
··· 307 307 err = damon_start(&ctx, 1, true); 308 308 if (err) 309 309 return err; 310 - kdamond_pid = ctx->kdamond->pid; 310 + kdamond_pid = damon_kdamond_pid(ctx); 311 + if (kdamond_pid < 0) 312 + return kdamond_pid; 311 313 return damon_call(ctx, &call_control); 312 314 } 313 315