From: SeongJae Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SeongJae Park <sj@kernel.org>,
Brendan Higgins <brendanhiggins@google.com>,
David Gow <davidgow@google.com>,
damon@lists.linux.dev, linux-mm@kvack.org,
linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com,
linux-kernel@vger.kernel.org
Subject: [PATCH 4/9] mm/damon/core-test: test only vaddr case on ops registration test
Date: Mon, 26 Aug 2024 20:03:31 -0700 [thread overview]
Message-ID: <20240827030336.7930-5-sj@kernel.org> (raw)
In-Reply-To: <20240827030336.7930-1-sj@kernel.org>
DAMON ops registration kunit test tests both vaddr and paddr use cases
in parts of the whole test cases. Basically testing only one ops use
case is enough. Do the test with only vaddr use case.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
mm/damon/core-test.h | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/mm/damon/core-test.h b/mm/damon/core-test.h
index 0cee634f3544..ef36d586d6ee 100644
--- a/mm/damon/core-test.h
+++ b/mm/damon/core-test.h
@@ -246,16 +246,12 @@ static void damon_test_split_regions_of(struct kunit *test)
static void damon_test_ops_registration(struct kunit *test)
{
struct damon_ctx *c = damon_new_ctx();
- struct damon_operations ops, bak;
+ struct damon_operations ops = {.id = DAMON_OPS_VADDR}, bak;
- /* DAMON_OPS_{V,P}ADDR are registered on subsys_initcall */
+ /* DAMON_OPS_VADDR is registered on subsys_initcall */
KUNIT_EXPECT_EQ(test, damon_select_ops(c, DAMON_OPS_VADDR), 0);
- KUNIT_EXPECT_EQ(test, damon_select_ops(c, DAMON_OPS_PADDR), 0);
/* Double-registration is prohibited */
- ops.id = DAMON_OPS_VADDR;
- KUNIT_EXPECT_EQ(test, damon_register_ops(&ops), -EINVAL);
- ops.id = DAMON_OPS_PADDR;
KUNIT_EXPECT_EQ(test, damon_register_ops(&ops), -EINVAL);
/* Unknown ops id cannot be registered */
--
2.39.2
next prev parent reply other threads:[~2024-08-27 3:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 3:03 [PATCH 0/9] misc fixups for DAMON {self,kunit} tests SeongJae Park
2024-08-27 3:03 ` [PATCH 1/9] selftests/damon: add access_memory_even to .gitignore SeongJae Park
2024-08-27 3:03 ` [PATCH 2/9] selftests/damon: cleanup __pycache__/ with 'make clean' SeongJae Park
2024-08-27 3:03 ` [PATCH 3/9] selftests/damon: add execute permissions to test scripts SeongJae Park
2024-08-27 3:03 ` SeongJae Park [this message]
2024-08-27 3:03 ` [PATCH 5/9] mm/damon/core-test: fix damon_test_ops_registration() for DAMON_VADDR unset case SeongJae Park
2024-08-27 3:03 ` [PATCH 6/9] mm/damon/dbgfs-test: skip dbgfs_set_targets() test if PADDR is not registered SeongJae Park
2024-08-27 3:03 ` [PATCH 7/9] mm/damon/dbgfs-test: skip dbgfs_set_init_regions() " SeongJae Park
2024-08-27 3:03 ` [PATCH 8/9] mm/damon: move kunit tests to tests/ subdirectory with _kunit suffix SeongJae Park
2024-08-27 3:03 ` [PATCH 9/9] mm/damon/tests: add .kunitconfig file for DAMON kunit tests SeongJae Park
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240827030336.7930-5-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=brendanhiggins@google.com \
--cc=damon@lists.linux.dev \
--cc=davidgow@google.com \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).