* [merged mm-stable] mm-damon-tests-core-kunit-test-psi-goal-values-with-explicit-samples.patch removed from -mm tree
@ 2026-10-24 8:58 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-10-24 8:58 UTC (permalink / raw)
To: mm-commits, sj, lianux.mm, kunwu.chan, davidgow, brendan.higgins,
kmehltretter, akpm
The quilt patch titled
Subject: mm/damon/tests/core-kunit: test PSI goal values with explicit samples
has been removed from the -mm tree. Its filename was
mm-damon-tests-core-kunit-test-psi-goal-values-with-explicit-samples.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Karl Mehltretter <kmehltretter@gmail.com>
Subject: mm/damon/tests/core-kunit: test PSI goal values with explicit samples
Date: Mon, 28 Sep 2026 01:39:57 -0700
Test the PSI current-value helper with explicit totals so the result does
not depend on the test system's memory pressure. Cover an unmeasured
consist goal, unmeasured temporal goals with zero and nonzero effective
quotas, and measured rounds for both tuners. Check last_psi_total after
each call.
Link: https://lore.kernel.org/20260928083959.4030-4-sj@kernel.org
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: SJ Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: SJ Park <sj@kernel.org>
Assisted-by: LLM
Cc: Lian Wang <lianux.mm@gmail.com>
Cc: Kunwu Chan <kunwu.chan@gmail.com>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@davidgow.net>
---
mm/damon/tests/core-kunit.h | 43 ++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
--- a/mm/damon/tests/core-kunit.h~mm-damon-tests-core-kunit-test-psi-goal-values-with-explicit-samples
+++ a/mm/damon/tests/core-kunit.h
@@ -952,6 +952,48 @@ static void damos_test_commit_quota_goal
});
}
+static void damos_test_set_psi_current_val(struct kunit *test)
+{
+ struct damos s = {
+ .quota.goal_tuner = DAMOS_QUOTA_GOAL_TUNER_CONSIST,
+ };
+ struct damos_quota_goal goal = {
+ .metric = DAMOS_QUOTA_SOME_MEM_PSI_US,
+ .target_value = 100,
+ .last_psi_total = U64_MAX,
+ };
+
+ /* uninitialized last_psi_total keeps the consist tuner quota */
+ damos_set_psi_current_val(1000, &goal, &s);
+ KUNIT_EXPECT_EQ(test, goal.current_value, 100ul);
+ KUNIT_EXPECT_EQ(test, goal.last_psi_total, 1000ull);
+
+ /* initialized last_psi_total gives the delta */
+ damos_set_psi_current_val(1030, &goal, &s);
+ KUNIT_EXPECT_EQ(test, goal.current_value, 30ul);
+ KUNIT_EXPECT_EQ(test, goal.last_psi_total, 1030ull);
+
+ /* temporal tuner keeps a zero quota */
+ s.quota.goal_tuner = DAMOS_QUOTA_GOAL_TUNER_TEMPORAL;
+ s.quota.esz = 0;
+ goal.last_psi_total = U64_MAX;
+ damos_set_psi_current_val(2000, &goal, &s);
+ KUNIT_EXPECT_EQ(test, goal.current_value, 100ul);
+ KUNIT_EXPECT_EQ(test, goal.last_psi_total, 2000ull);
+
+ /* temporal tuner keeps a non-zero quota */
+ s.quota.esz = SZ_64K;
+ goal.last_psi_total = U64_MAX;
+ damos_set_psi_current_val(3000, &goal, &s);
+ KUNIT_EXPECT_EQ(test, goal.current_value, 0ul);
+ KUNIT_EXPECT_EQ(test, goal.last_psi_total, 3000ull);
+
+ /* temporal tuner uses the measured PSI delta */
+ damos_set_psi_current_val(3250, &goal, &s);
+ KUNIT_EXPECT_EQ(test, goal.current_value, 250ul);
+ KUNIT_EXPECT_EQ(test, goal.last_psi_total, 3250ull);
+}
+
static void damos_test_commit_quota_goals_for(struct kunit *test,
struct damos_quota_goal *dst_goals, int nr_dst_goals,
struct damos_quota_goal *src_goals, int nr_src_goals)
@@ -2413,6 +2455,7 @@ static struct kunit_case damon_test_case
KUNIT_CASE(damos_test_new_filter),
KUNIT_CASE(damos_test_new_scheme_keeps_src_quota),
KUNIT_CASE(damos_test_commit_quota_goal),
+ KUNIT_CASE(damos_test_set_psi_current_val),
KUNIT_CASE(damos_test_commit_quota_goals),
KUNIT_CASE(damos_test_commit_quota),
KUNIT_CASE(damos_test_commit_dests),
_
Patches currently in -mm which might be from kmehltretter@gmail.com are
squashfs-fix-fragment-index-table-sizing-overflow-on-32-bit.patch
squashfs-make-the-fragment-index-table-bounds-check-overflow-safe.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-24 8:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-24 8:58 [merged mm-stable] mm-damon-tests-core-kunit-test-psi-goal-values-with-explicit-samples.patch removed from -mm tree Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.