Skip to contentSkip to conversation

selftests/damon/damos_quota_goal: handle minimum quota that cannot be further reduced

PATCH Applied SeongJae Park 1 participant 1 message Feb 17, 2025

Subsystems (4)
lore
Share & tools
lore

SeongJae Park

author maintainer
#0 lore raw

PATCH 1/1 selftests/damon/damos_quota_goal: handle minimum quota that cannot be further reduced

damos_quota_goal.py selftest see if DAMOS quota goals tuning feature increases or reduces the effective size quota for given score as expected. The tuning feature sets the minimum quota size as one byte, so if the effective size quota is already one, we cannot expect it further be reduced. However the test is not aware of the edge case, and fails since it shown no expected change of the effective quota. Handle the case by updating the failure logic for no change to see if it was the case, and simply skips to next test input.

Fixes f1c07c0a1662b ("selftests/damon: add a test for DAMOS quota goal")
Cc <[email protected]> # 6.10.x
---
 tools/testing/selftests/damon/damos_quota_goal.py | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/damon/damos_quota_goal.py +3 -0
index 18246f3b62f7..f76e0412b564 100755
@@ -63,6 +63,9 @@ def main():
             if last_effective_bytes != 0 else -1.0))
 
         if last_effective_bytes == goal.effective_bytes:
+            # effective quota was already minimum that cannot be more reduced
+            if expect_increase is False and last_effective_bytes == 1:
+                continue
             print('efective bytes not changed: %d' % goal.effective_bytes)
             exit(1)
 

base-commit: 20017459916819f8ae15ca3840e71fbf0ea8354e

Signature · 1 line
2.39.5