1 From 349db086a66051bc6114b64b4446787c20ac3f00 Mon Sep 17 00:00:00 2001
2 From: SeongJae Park <sj@kernel.org>
3 Date: Mon, 17 Feb 2025 10:23:04 -0800
4 Subject: selftests/damon/damos_quota_goal: handle minimum quota that cannot be further reduced
6 From: SeongJae Park <sj@kernel.org>
8 commit 349db086a66051bc6114b64b4446787c20ac3f00 upstream.
10 damos_quota_goal.py selftest see if DAMOS quota goals tuning feature
11 increases or reduces the effective size quota for given score as expected.
12 The tuning feature sets the minimum quota size as one byte, so if the
13 effective size quota is already one, we cannot expect it further be
14 reduced. However the test is not aware of the edge case, and fails since
15 it shown no expected change of the effective quota. Handle the case by
16 updating the failure logic for no change to see if it was the case, and
17 simply skips to next test input.
19 Link: https://lkml.kernel.org/r/20250217182304.45215-1-sj@kernel.org
20 Fixes: f1c07c0a1662 ("selftests/damon: add a test for DAMOS quota goal")
21 Signed-off-by: SeongJae Park <sj@kernel.org>
22 Reported-by: kernel test robot <oliver.sang@intel.com>
23 Closes: https://lore.kernel.org/oe-lkp/202502171423.b28a918d-lkp@intel.com
24 Cc: Shuah Khan <shuah@kernel.org>
25 Cc: <stable@vger.kernel.org> [6.10.x]
26 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
27 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 tools/testing/selftests/damon/damos_quota_goal.py | 3 +++
30 1 file changed, 3 insertions(+)
32 --- a/tools/testing/selftests/damon/damos_quota_goal.py
33 +++ b/tools/testing/selftests/damon/damos_quota_goal.py
34 @@ -63,6 +63,9 @@ def main():
35 if last_effective_bytes != 0 else -1.0))
37 if last_effective_bytes == goal.effective_bytes:
38 + # effective quota was already minimum that cannot be more reduced
39 + if expect_increase is False and last_effective_bytes == 1:
41 print('efective bytes not changed: %d' % goal.effective_bytes)