Skip to content

Commit

Permalink
mm/damon/dbgfs-test: fix is_target_id() change
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
SeongJae Park authored and Linus Torvalds committed Mar 22, 2022
1 parent 4a20865 commit 999b946
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mm/damon/dbgfs-test.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static void damon_dbgfs_test_set_targets(struct kunit *test)
char buf[64];

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

dbgfs_set_targets(ctx, 0, NULL);
sprint_target_ids(ctx, buf, 64);
Expand Down Expand Up @@ -111,6 +111,8 @@ static void damon_dbgfs_test_set_init_regions(struct kunit *test)
int i, rc;
char buf[256];

damon_select_ops(ctx, DAMON_OPS_PADDR);

dbgfs_set_targets(ctx, 3, NULL);

/* Put valid inputs and check the results */
Expand Down

0 comments on commit 999b946

Please sign in to comment.