summaryrefslogtreecommitdiffstats
path: root/mm/damon/reclaim.c
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2022-03-22 22:48:55 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-22 23:57:12 +0100
commit4d69c3457821100a39fa8c6e0c23ed910bb6c29d (patch)
treea466883d6b0ed37e1063c903c8993d0f8a7bc104 /mm/damon/reclaim.c
parentmm/damon/paddr,vaddr: register themselves to DAMON in subsys_initcall (diff)
downloadlinux-4d69c3457821100a39fa8c6e0c23ed910bb6c29d.tar.xz
linux-4d69c3457821100a39fa8c6e0c23ed910bb6c29d.zip
mm/damon/reclaim: use damon_select_ops() instead of damon_{v,p}a_set_operations()
This commit makes DAMON_RECLAIM to select the registered monitoring operations for the physical address space instead of setting it on its own. This allows DAMON_RECLAIM be independent of DAMON_PADDR, but leave the dependency as is, because it's the only one monitoring operations it use, and therefore it makes no sense to build DAMON_RECLAIM without DAMON_PADDR. Link: https://lkml.kernel.org/r/20220215184603.1479-5-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Xin Hao <xhao@linux.alibaba.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r--mm/damon/reclaim.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c
index 3c93095c793c..b53d9c22fad1 100644
--- a/mm/damon/reclaim.c
+++ b/mm/damon/reclaim.c
@@ -384,7 +384,9 @@ static int __init damon_reclaim_init(void)
if (!ctx)
return -ENOMEM;
- damon_pa_set_operations(ctx);
+ if (damon_select_ops(ctx, DAMON_OPS_PADDR))
+ return -EINVAL;
+
ctx->callback.after_aggregation = damon_reclaim_after_aggregation;
target = damon_new_target();