From: Jason Angelov <jasonangelov@ucla.edu>
To: SJ Park <sj@kernel.org>, Andrew Morton <akpm@linux-foundation.org>
Cc: damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
Jason Angelov <jasonangelov@ucla.edu>
Subject: [PATCH v2 1/3] mm/damon/tests/core-kunit: test DAMOS_FILTER_TYPE_AGE_MS in damos_test_commit_filter()
Date: Mon, 16 Nov 2026 03:06:21 -0800 [thread overview]
Message-ID: <20261116-test-age-ms-filter-v2-1-3b265d59ec98@ucla.edu> (raw)
In-Reply-To: <20261116-test-age-ms-filter-v2-0-3b265d59ec98@ucla.edu>
Add kunit tests that commit DAMOS core filter type
DAMOS_FILTER_TYPE_AGE_MS.
Reviewed-by: SJ Park <sj@kernel.org>
Signed-off-by: Jason Angelov <jasonangelov@ucla.edu>
---
mm/damon/tests/core-kunit.h | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h
index a5ca4bfe2f0d..0eb5dcdba0ae 100644
--- a/mm/damon/tests/core-kunit.h
+++ b/mm/damon/tests/core-kunit.h
@@ -1271,6 +1271,10 @@ static void damos_test_commit_filter_for(struct kunit *test,
KUNIT_EXPECT_EQ(test, dst->matching, src->matching);
KUNIT_EXPECT_EQ(test, dst->allow, src->allow);
switch (src->type) {
+ case DAMOS_FILTER_TYPE_AGE_MS:
+ KUNIT_EXPECT_EQ(test, dst->range_min, src->range_min);
+ KUNIT_EXPECT_EQ(test, dst->range_max, src->range_max);
+ break;
case DAMOS_FILTER_TYPE_MEMCG:
KUNIT_EXPECT_EQ(test, dst->memcg_id, src->memcg_id);
break;
@@ -1304,6 +1308,22 @@ static void damos_test_commit_filter(struct kunit *test)
.allow = false,
};
+ damos_test_commit_filter_for(test, &dst,
+ &(struct damos_filter){
+ .type = DAMOS_FILTER_TYPE_AGE_MS,
+ .matching = true,
+ .allow = true,
+ .range_min = 36,
+ .range_max = 14
+ }, true);
+ damos_test_commit_filter_for(test, &dst,
+ &(struct damos_filter){
+ .type = DAMOS_FILTER_TYPE_AGE_MS,
+ .matching = true,
+ .allow = true,
+ .range_min = 14,
+ .range_max = 36
+ }, false);
damos_test_commit_filter_for(test, &dst,
&(struct damos_filter){
.type = DAMOS_FILTER_TYPE_ANON,
--
2.53.0
next prev parent reply other threads:[~2026-11-16 11:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 11:06 [PATCH v2 0/3] mm/damon/tests: add KUnit coverage for age_ms filters Jason Angelov
2026-11-16 11:06 ` Jason Angelov [this message]
2026-11-16 11:06 ` [PATCH v2 2/3] mm/damon/tests/core-kunit: test DAMOS_FILTER_TYPE_AGE_MS in damos_filter_for_ops() Jason Angelov
2026-11-16 11:06 ` [PATCH v2 3/3] mm/damon/tests/core-kunit: test DAMOS_FILTER_TYPE_AGE_MS interval changes Jason Angelov
2026-11-16 15:22 ` SJ Park
2026-11-16 11:25 ` [PATCH v2 0/3] mm/damon/tests: add KUnit coverage for age_ms filters Aveline Noir
2026-11-16 15:28 ` SJ 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=20261116-test-age-ms-filter-v2-1-3b265d59ec98@ucla.edu \
--to=jasonangelov@ucla.edu \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sj@kernel.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
all inboxes | Powered by JetHome®