diff options
| author | SeongJae Park <sj@kernel.org> | 2025-07-20 20:16:35 +0300 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2025-07-27 01:08:17 +0300 |
| commit | 229b0af6640704bb709fae356108c11d6e63058d (patch) | |
| tree | 42ec61410da13f9c2cd7c955a0dbf479554f5f20 | |
| parent | ff5aae307bfb789c9e9c4564bc19d5393aa2fc43 (diff) | |
| download | linux-229b0af6640704bb709fae356108c11d6e63058d.tar.xz | |
selftests/damon/_damon_sysfs: support DAMOS quota goal nid setup
_damon_sysfs.py contains code for test-purpose DAMON sysfs interface
control. Add support of DAMOS quota goal nid setup for more tests.
Link: https://lkml.kernel.org/r/20250720171652.92309-6-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>
| -rw-r--r-- | tools/testing/selftests/damon/_damon_sysfs.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/testing/selftests/damon/_damon_sysfs.py b/tools/testing/selftests/damon/_damon_sysfs.py index 12d076260b2b..23de9202b4e3 100644 --- a/tools/testing/selftests/damon/_damon_sysfs.py +++ b/tools/testing/selftests/damon/_damon_sysfs.py @@ -93,14 +93,16 @@ class DamosQuotaGoal: metric = None target_value = None current_value = None + nid = None effective_bytes = None quota = None # owner quota idx = None - def __init__(self, metric, target_value=10000, current_value=0): + def __init__(self, metric, target_value=10000, current_value=0, nid=0): self.metric = metric self.target_value = target_value self.current_value = current_value + self.nid = nid def sysfs_dir(self): return os.path.join(self.quota.sysfs_dir(), 'goals', '%d' % self.idx) @@ -118,6 +120,10 @@ class DamosQuotaGoal: self.current_value) if err is not None: return err + err = write_file(os.path.join(self.sysfs_dir(), 'nid'), self.nid) + if err is not None: + return err + return None class DamosQuota: |
