mm/damon/vaddr: put pid in cleanup_target()

Implement cleanup_target() callback for [f]vaddr, which calls put_pid()
for each target that will be destroyed.  Also remove redundant put_pid()
calls in core, sysfs and sample modules, which were required to be done
redundantly due to the lack of such self cleanup in vaddr.

Link: https://lkml.kernel.org/r/20250712195016.151108-11-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
SeongJae Park
2025-07-12 12:50:12 -07:00
committed by Andrew Morton
parent 7114bc5e01
commit ff01aba6e4
5 changed files with 8 additions and 14 deletions
-2
View File
@@ -120,8 +120,6 @@ static void damon_sample_prcl_stop(void)
damon_stop(&ctx, 1);
damon_destroy_ctx(ctx);
}
if (target_pidp)
put_pid(target_pidp);
}
static bool init_called;
-2
View File
@@ -100,8 +100,6 @@ static void damon_sample_wsse_stop(void)
damon_stop(&ctx, 1);
damon_destroy_ctx(ctx);
}
if (target_pidp)
put_pid(target_pidp);
}
static bool init_called;