From: SeongJae Park <sj@kernel.org>
Cc: SeongJae Park <sj@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Brendan Higgins <brendan.higgins@linux.dev>,
David Gow <davidgow@google.com>,
damon@lists.linux.dev, kunit-dev@googlegroups.com,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-mm@kvack.org
Subject: [RFC PATCH 6/9] mm/damon/tests/core-kunit: test fail_charge_{num,denom} committing
Date: Sat, 4 Apr 2026 09:39:36 -0700 [thread overview]
Message-ID: <20260404163943.89278-7-sj@kernel.org> (raw)
In-Reply-To: <20260404163943.89278-1-sj@kernel.org>
Extend damos_test_commit_quotas() kunit test to ensure
damos_commit_quota() handles fail_charge_{num,denom} parameters.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
mm/damon/tests/core-kunit.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h
index 0030f682b23b7..16f68315ba119 100644
--- a/mm/damon/tests/core-kunit.h
+++ b/mm/damon/tests/core-kunit.h
@@ -694,6 +694,8 @@ static void damos_test_commit_quota(struct kunit *test)
.ms = 2,
.sz = 3,
.goal_tuner = DAMOS_QUOTA_GOAL_TUNER_CONSIST,
+ .fail_charge_num = 2,
+ .fail_charge_denom = 3,
.weight_sz = 4,
.weight_nr_accesses = 5,
.weight_age = 6,
@@ -703,6 +705,8 @@ static void damos_test_commit_quota(struct kunit *test)
.ms = 8,
.sz = 9,
.goal_tuner = DAMOS_QUOTA_GOAL_TUNER_TEMPORAL,
+ .fail_charge_num = 1,
+ .fail_charge_denom = 1024,
.weight_sz = 10,
.weight_nr_accesses = 11,
.weight_age = 12,
@@ -717,6 +721,8 @@ static void damos_test_commit_quota(struct kunit *test)
KUNIT_EXPECT_EQ(test, dst.ms, src.ms);
KUNIT_EXPECT_EQ(test, dst.sz, src.sz);
KUNIT_EXPECT_EQ(test, dst.goal_tuner, src.goal_tuner);
+ KUNIT_EXPECT_EQ(test, dst.fail_charge_num, 1);
+ KUNIT_EXPECT_EQ(test, dst.fail_charge_denom, 1024);
KUNIT_EXPECT_EQ(test, dst.weight_sz, src.weight_sz);
KUNIT_EXPECT_EQ(test, dst.weight_nr_accesses, src.weight_nr_accesses);
KUNIT_EXPECT_EQ(test, dst.weight_age, src.weight_age);
--
2.47.3
next prev parent reply other threads:[~2026-04-04 16:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-04 16:39 [RFC PATCH 0/9] mm/damon: introduce DAMOS failed region quota charge ratio SeongJae Park
2026-04-04 16:39 ` [RFC PATCH 1/9] mm/damon/core: introduce " SeongJae Park
2026-04-04 20:46 ` (sashiko review) " SeongJae Park
2026-04-04 16:39 ` [RFC PATCH 2/9] mm/damon/sysfs-schemes: implement fail_charge_{num,denom} files SeongJae Park
2026-04-04 20:52 ` (sashiko review) " SeongJae Park
2026-04-04 16:39 ` [RFC PATCH 3/9] Docs/mm/damon/design: document fail_charge_{num,denom} SeongJae Park
2026-04-04 20:58 ` (sashiko review) " SeongJae Park
2026-04-04 16:39 ` [RFC PATCH 4/9] Docs/admin-guide/mm/damon/usage: document fail_charge_{num,denom} files SeongJae Park
2026-04-04 21:01 ` (sashiko review) " SeongJae Park
2026-04-04 16:39 ` [RFC PATCH 5/9] Docs/ABI/damon: document fail_charge_{num,denom} SeongJae Park
2026-04-04 16:39 ` SeongJae Park [this message]
2026-04-04 21:03 ` (sashiko review) [RFC PATCH 6/9] mm/damon/tests/core-kunit: test fail_charge_{num,denom} committing SeongJae Park
2026-04-04 16:39 ` [RFC PATCH 7/9] selftets/damon/_damon_sysfs: support failed region quota charge ratio SeongJae Park
2026-04-04 16:39 ` [RFC PATCH 8/9] selftests/damon/drgn_dump_damon_status: " SeongJae Park
2026-04-04 16:39 ` [RFC PATCH 9/9] selftets/damon/sysfs.py: test " SeongJae Park
2026-04-04 21:06 ` (sashiko status) [RFC PATCH 0/9] mm/damon: introduce DAMOS " 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=20260404163943.89278-7-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=brendan.higgins@linux.dev \
--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