* [merged mm-stable] selftests-damon-sysfspy-generalize-damos-watermarks-commit-assertion.patch removed from -mm tree
@ 2025-07-26 22:10 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-07-26 22:10 UTC (permalink / raw)
To: mm-commits, shuah, sj, akpm
The quilt patch titled
Subject: selftests/damon/sysfs.py: generalize DAMOS Watermarks commit assertion
has been removed from the -mm tree. Its filename was
selftests-damon-sysfspy-generalize-damos-watermarks-commit-assertion.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 <sj@kernel.org>
Subject: selftests/damon/sysfs.py: generalize DAMOS Watermarks commit assertion
Date: Sun, 20 Jul 2025 10:16:42 -0700
DamosWatermarks commitment assertion is hard-coded for a specific test
case. Split it out into a general version that can be reused for
different test cases.
Link: https://lkml.kernel.org/r/20250720171652.92309-13-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
tools/testing/selftests/damon/sysfs.py | 26 +++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
--- a/tools/testing/selftests/damon/sysfs.py~selftests-damon-sysfspy-generalize-damos-watermarks-commit-assertion
+++ a/tools/testing/selftests/damon/sysfs.py
@@ -29,6 +29,22 @@ def fail(expectation, status):
print(json.dumps(status, indent=4))
exit(1)
+def assert_true(condition, expectation, status):
+ if condition is not True:
+ fail(expectation, status)
+
+def assert_watermarks_committed(watermarks, dump):
+ wmark_metric_val = {
+ 'none': 0,
+ 'free_mem_rate': 1,
+ }
+ assert_true(dump['metric'] == wmark_metric_val[watermarks.metric],
+ 'metric', dump)
+ assert_true(dump['interval'] == watermarks.interval, 'interval', dump)
+ assert_true(dump['high'] == watermarks.high, 'high', dump)
+ assert_true(dump['mid'] == watermarks.mid, 'mid', dump)
+ assert_true(dump['low'] == watermarks.low, 'low', dump)
+
def main():
kdamonds = _damon_sysfs.Kdamonds(
[_damon_sysfs.Kdamond(
@@ -105,14 +121,8 @@ def main():
}:
fail('damos quota', status)
- if scheme['wmarks'] != {
- 'metric': 0,
- 'interval': 0,
- 'high': 0,
- 'mid': 0,
- 'low': 0,
- }:
- fail('damos wmarks', status)
+ assert_watermarks_committed(_damon_sysfs.DamosWatermarks(),
+ scheme['wmarks'])
kdamonds.stop()
_
Patches currently in -mm which might be from sj@kernel.org are
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-07-26 22:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-26 22:10 [merged mm-stable] selftests-damon-sysfspy-generalize-damos-watermarks-commit-assertion.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.