summaryrefslogtreecommitdiff
path: root/mm/damon/core-test.h
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2022-03-23 00:48:37 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-23 01:57:12 +0300
commit436428255d5981e49ff015fc8e398ecf2ba10c24 (patch)
treed1cf88d248ba7cc1c88b6e4762e917fb24e0ad4e /mm/damon/core-test.h
parent8041c87b915b9b7ecb2870f1c529a75aaa2483be (diff)
downloadlinux-436428255d5981e49ff015fc8e398ecf2ba10c24.tar.xz
mm/damon/core: move damon_set_targets() into dbgfs
damon_set_targets() function is defined in the core for general use cases, but called from only dbgfs. Also, because the function is for general use cases, dbgfs does additional handling of pid type target id case. To make the situation simpler, this commit moves the function into dbgfs and makes it to do the pid type case handling on its own. Link: https://lkml.kernel.org/r/20211230100723.2238-4-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/damon/core-test.h')
-rw-r--r--mm/damon/core-test.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/damon/core-test.h b/mm/damon/core-test.h
index 7008c3735e99..4a6141ddd6fc 100644
--- a/mm/damon/core-test.h
+++ b/mm/damon/core-test.h
@@ -86,7 +86,10 @@ static void damon_test_aggregate(struct kunit *test)
struct damon_region *r;
int it, ir;
- damon_set_targets(ctx, target_ids, 3);
+ for (it = 0; it < 3; it++) {
+ t = damon_new_target(target_ids[it]);
+ damon_add_target(ctx, t);
+ }
it = 0;
damon_for_each_target(t, ctx) {