summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2026-01-17 20:52:49 +0300
committerAndrew Morton <akpm@linux-foundation.org>2026-02-01 01:22:45 +0300
commit1736047a4e9606f11e044431dfe61516e3a7600b (patch)
tree90cffd58c883851c1a828ca020e101cf20156a5d /include/linux
parent50962b16c0d63725fa73f0a5b4b831f740cf7208 (diff)
downloadlinux-1736047a4e9606f11e044431dfe61516e3a7600b.tar.xz
mm/damon/core: cleanup targets and regions at once on kdamond termination
When kdamond terminates, it destroys the regions of the context first, and the targets of the context just before the kdamond main function returns. Because regions are linked inside targets, doing them separately is only inefficient and looks weird. A more serious problem is that the cleanup of the targets is done after damon_ctx->kdamond reset, which is the event that lets DAMON API callers know the kdamond is no longer actively running. That is, some DAMON targets could still exist while kdamond is not running. There are no real problems from this, but this implicit fact could cause subtle racy issues in future. Destroy targets and regions at one. Adding contexts on how the code has evolved in the way. Doing only regions destruction was because putting pids of the targets were done on DAMON API callers. Commit 7114bc5e01cf ("mm/damon/core: add cleanup_target() ops callback") moved the role to be done via operations set on each target destruction. Hence it removed the reason to do only regions cleanup. Commit 3a69f1635769 ("mm/damon/core: destroy targets when kdamond_fn() finish") therefore further destructed targets on kdamond termination time. It was still separated from regions destruction because damon_operations->cleanup() may do additional targets cleanup. Placing the targets destruction after damon_ctx->kdamond reset was just an unnecessary decision of the commit. The previous commit removed damon_operations->cleanup(), so there is no more reason to do destructions of regions and targets separately. Link: https://lkml.kernel.org/r/20260117175256.82826-3-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions