Skip to contentSkip to conversation

selftests-damon-sysfspy-test-quota-goal-commitment.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jul 26, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: selftests/damon/sysfs.py: test quota goal commitment
has been removed from the -mm tree. Its filename was
selftests-damon-sysfspy-test-quota-goal-commitment.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: SeongJae Park <[email protected]>
Subject: selftests/damon/sysfs.py: test quota goal commitment
Date: Sun, 20 Jul 2025 10:16:44 -0700

Current DAMOS quota commitment assertion is not testing quota goal commitment. Add the test.

---

 tools/testing/selftests/damon/sysfs.py |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
tools/testing/selftests/damon/sysfs.py renamed from tools/testing/selftests/damon/sysfs.py~selftests-damon-sysfspy-test-quota-goal-commitment +17 -1
@@ -45,12 +45,28 @@ def assert_watermarks_committed(watermar
     assert_true(dump['mid'] == watermarks.mid, 'mid', dump)
     assert_true(dump['low'] == watermarks.low, 'low', dump)
 
+def assert_quota_goal_committed(qgoal, dump):
+    metric_val = {
+            'user_input': 0,
+            'some_mem_psi_us': 1,
+            'node_mem_used_bp': 2,
+            'node_mem_free_bp': 3,
+            }
+    assert_true(dump['metric'] == metric_val[qgoal.metric], 'metric', dump)
+    assert_true(dump['target_value'] == qgoal.target_value, 'target_value',
+                dump)
+    if qgoal.metric == 'user_input':
+        assert_true(dump['current_value'] == qgoal.current_value,
+                    'current_value', dump)
+    assert_true(dump['nid'] == qgoal.nid, 'nid', dump)
+
 def assert_quota_committed(quota, dump):
     assert_true(dump['reset_interval'] == quota.reset_interval_ms,
                 'reset_interval', dump)
     assert_true(dump['ms'] == quota.ms, 'ms', dump)
     assert_true(dump['sz'] == quota.sz, 'sz', dump)
-    # TODO: assert goals are committed
+    for idx, qgoal in enumerate(quota.goals):
+        assert_quota_goal_committed(qgoal, dump['goals'][idx])
     assert_true(dump['weight_sz'] == quota.weight_sz_permil, 'weight_sz', dump)
     assert_true(dump['weight_nr_accesses'] == quota.weight_nr_accesses_permil,
                 'weight_nr_accesses', dump)

_

Patches currently in -mm which might be from [email protected] are