Skip to content

Commit 999b946

Browse files
sjp38torvalds
authored andcommitted
mm/damon/dbgfs-test: fix is_target_id() change
DAMON kunit tests for DAMON debugfs interface fails because it still assumes setting empty monitoring operations makes DAMON debugfs interface believe the target of the context don't have pid. This commit fixes the kunit test fails by explicitly setting the context's monitoring operations with the operations for the physical address space, which let debugfs knows the target will not have pid. Link: https://lkml.kernel.org/r/20220215184603.1479-8-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>
1 parent 4a20865 commit 999b946

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

mm/damon/dbgfs-test.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static void damon_dbgfs_test_set_targets(struct kunit *test)
7474
char buf[64];
7575

7676
/* Make DAMON consider target has no pid */
77-
ctx->ops = (struct damon_operations){};
77+
damon_select_ops(ctx, DAMON_OPS_PADDR);
7878

7979
dbgfs_set_targets(ctx, 0, NULL);
8080
sprint_target_ids(ctx, buf, 64);
@@ -111,6 +111,8 @@ static void damon_dbgfs_test_set_init_regions(struct kunit *test)
111111
int i, rc;
112112
char buf[256];
113113

114+
damon_select_ops(ctx, DAMON_OPS_PADDR);
115+
114116
dbgfs_set_targets(ctx, 3, NULL);
115117

116118
/* Put valid inputs and check the results */

0 commit comments

Comments
 (0)