[RFC PATCH v1.2 1/4] mm/damon/tests/core-kunit: test committing psi goal to psi goal

From: SJ Park

Date: Thu Aug 27 2026 - 21:47:18 EST


damon_test_commit_quota_goal_for() is set to test committing a new psi
goal on an existing psi goal. However, damon_test_commit_quota_goal()
is mistakenly not covering the test case. Add the test case.

Fixes: 99f89debafc5 ("mm/damon/tests/core-kunit: add damos_commit_quota_goal() test")
Cc: <stable@xxxxxxxxxxxxxxx> # 6.19.x
Signed-off-by: SJ Park <sj@xxxxxxxxxx>
---
mm/damon/tests/core-kunit.h | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h
index 4a536d41cdb2d..b643f9a83f14a 100644
--- a/mm/damon/tests/core-kunit.h
+++ b/mm/damon/tests/core-kunit.h
@@ -787,6 +787,13 @@ static void damos_test_commit_quota_goal(struct kunit *test)
.last_psi_total = 456,
};

+ damos_test_commit_quota_goal_for(test, &dst,
+ &(struct damos_quota_goal) {
+ .metric = DAMOS_QUOTA_SOME_MEM_PSI_US,
+ .target_value = 234,
+ .current_value = 345,
+ .last_psi_total = 567,
+ });
damos_test_commit_quota_goal_for(test, &dst,
&(struct damos_quota_goal){
.metric = DAMOS_QUOTA_USER_INPUT,
--
2.47.3