* + selftests-damon-_damon_sysfs-implement-updat_schemes_tried_bytes-command.patch added to mm-unstable branch
@ 2023-12-12 20:29 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-12-12 20:29 UTC (permalink / raw)
To: mm-commits, shuah, sj, akpm
The patch titled
Subject: selftests/damon/_damon_sysfs: implement updat_schemes_tried_bytes command
has been added to the -mm mm-unstable branch. Its filename is
selftests-damon-_damon_sysfs-implement-updat_schemes_tried_bytes-command.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-damon-_damon_sysfs-implement-updat_schemes_tried_bytes-command.patch
This patch will later appear in the mm-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: SeongJae Park <sj@kernel.org>
Subject: selftests/damon/_damon_sysfs: implement updat_schemes_tried_bytes command
Date: Tue, 12 Dec 2023 19:48:08 +0000
Implement update_schemes_tried_bytes command of DAMON sysfs interface in
_damon_sysfs.py. It is not only making the update, but also read the
updated value from the sysfs interface and store it in the Kdamond python
objects so that the user of the module can easily get the value.
Link: https://lkml.kernel.org/r/20231212194810.54457-4-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/_damon_sysfs.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
--- a/tools/testing/selftests/damon/_damon_sysfs.py~selftests-damon-_damon_sysfs-implement-updat_schemes_tried_bytes-command
+++ a/tools/testing/selftests/damon/_damon_sysfs.py
@@ -76,6 +76,7 @@ class Damos:
# todo: Support quotas, watermarks, stats, tried_regions
idx = None
context = None
+ tried_bytes = None
def __init__(self, action='stat', access_pattern=DamosAccessPattern()):
self.action = action
@@ -284,6 +285,19 @@ class Kdamond:
err = write_file(os.path.join(self.sysfs_dir(), 'state'), 'on')
return err
+ def update_schemes_tried_bytes(self):
+ err = write_file(os.path.join(self.sysfs_dir(), 'state'),
+ 'update_schemes_tried_bytes')
+ if err != None:
+ return err
+ for context in self.contexts:
+ for scheme in context.schemes:
+ content, err = read_file(os.path.join(scheme.sysfs_dir(),
+ 'tried_regions', 'total_bytes'))
+ if err != None:
+ return err
+ scheme.tried_bytes = int(content)
+
class Kdamonds:
kdamonds = []
_
Patches currently in -mm which might be from sj@kernel.org are
mm-damon-core-make-damon_start-waits-until-kdamond_fn-starts.patch
selftests-damon-implement-a-python-module-for-test-purpose-damon-sysfs-controls.patch
selftests-damon-_damon_sysfs-implement-kdamonds-start-function.patch
selftests-damon-_damon_sysfs-implement-updat_schemes_tried_bytes-command.patch
selftests-damon-add-a-test-for-update_schemes_tried_regions-sysfs-command.patch
selftests-damon-add-a-test-for-update_schemes_tried_regions-hang-bug.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-12 20:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-12 20:29 + selftests-damon-_damon_sysfs-implement-updat_schemes_tried_bytes-command.patch added to mm-unstable branch 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.