mm/damon/core: destroy targets when kdamond_fn() finish
authorSeongJae Park <sj@kernel.org>
Sat, 12 Jul 2025 19:50:14 +0000 (12:50 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 20 Jul 2025 01:59:56 +0000 (18:59 -0700)
commit3a69f1635769e976151625798cc6597301150296
tree958829b7411bedd5eda6fb643a7c2af1aaf2285b
parentf59ae147abb7905cc4656cee5c4c6ae7b53db75a
mm/damon/core: destroy targets when kdamond_fn() finish

When kdamond_fn() completes, the targets are kept.  Those are kept to let
callers do additional cleanups if they need.  There are no such additional
cleanups though.  DAMON sysfs interface deallocates those in
before_terminate() callback, to reduce unnecessary memory usage, for
[f]vaddr use case.  Just destroy the targets for every case in the core
layer.  This saves more memory and simplifies the logic.

Link: https://lkml.kernel.org/r/20250712195016.151108-13-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/core.c