damon.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
Cc: SeongJae Park <sj@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Shuah Khan <shuah@kernel.org>,
	damon@lists.linux.dev, linux-mm@kvack.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH 0/5] selftests/damon: add Python modules for DAMON control and functionality tests
Date: Sat,  2 Dec 2023 00:08:01 +0000	[thread overview]
Message-ID: <20231202000806.46210-1-sj@kernel.org> (raw)

DAMON provides almost all control to the user via its sysfs interface.
For that, the interface provides plenty of files and hierarchies.  The
interface is simple enough to be controlled by shell commands including
'cat', 'echo', and redirection.  However, due to the number of files and
the hierarchies, doing that repeatedly is quite tedious.  As a result,
DAMON selftests are containing only simple test cases rather than real
functionality tests.  Having a wrapper script that can be reused to
implement more functionality tests could be helpful.  Writing such
wrapper with shell script might be challenging and not easy to further
maintain and extend for future DAMON interface extensions, though.

To this end, implement a Python-written DAMON sysfs interface wrapper
that could be easily managed and extended for future DAMON interface
extensions.  Further implement one simple functionality test and a
corner case regression test for a previously found bug, using the
wrapper module.  In fact, the bug was found by the test this patchset is
introducing.

Note that the Python wrapper is not supporting full features of DAMON
interface, but only some of those that essential for the tests that this
patchset is introducing.  The wrapper would extended to support more
features, but only with essential ones for such future tests.  The
wrapper will hence keep being simple, small, and constrained.  For
convenient and general use cases of DAMON, users should use DAMON
user-space tools for such purpose, like damo[1].

[1] https://github.com/damonitor/damo

Patches Sequence
----------------

This patchset is constructed with five patches.  The first three patches
implement the Python-written DAMON sysfs interface wrapper in small
steps.  The basic data structure (first patch), kdamond startup command
(second patch), and finally DAMOS tried bytes command (third patch).

Then two patches for adding selftests using the wrapper follows.  The
fourth patch implements a basic functionality test of DAMON for working
set estimation accuracy.  Finally, the fifth patch implements a corner
case test for a previously found bug.

SeongJae Park (5):
  selftests/damon: add a DAMON interface wrapper python module
  selftests/damon/_damon: implement sysfs-based kdamonds start function
  selftests/damon/_damon: implement sysfs updat_schemes_tried_bytes
    command
  selftests/damon: add a test for update_schemes_tried_regions sysfs
    command
  selftests/damon: add a test for update_schemes_tried_regions hang bug

 tools/testing/selftests/damon/Makefile        |   3 +
 tools/testing/selftests/damon/_damon.py       | 322 ++++++++++++++++++
 tools/testing/selftests/damon/access_memory.c |  41 +++
 ...sysfs_update_schemes_tried_regions_hang.py |  33 ++
 ...te_schemes_tried_regions_wss_estimation.py |  48 +++
 5 files changed, 447 insertions(+)
 create mode 100644 tools/testing/selftests/damon/_damon.py
 create mode 100644 tools/testing/selftests/damon/access_memory.c
 create mode 100755 tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_hang.py
 create mode 100755 tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_wss_estimation.py


base-commit: 1be383c41197b82cfd51b2edc7ee515c0b786496
-- 
2.34.1


             reply	other threads:[~2023-12-02  0:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-02  0:08 SeongJae Park [this message]
2023-12-02  0:08 ` [RFC PATCH 1/5] selftests/damon: add a DAMON interface wrapper python module SeongJae Park
2023-12-02  0:08 ` [RFC PATCH 2/5] selftests/damon/_damon: implement sysfs-based kdamonds start function SeongJae Park
2023-12-02  0:08 ` [RFC PATCH 3/5] selftests/damon/_damon: implement sysfs updat_schemes_tried_bytes command SeongJae Park
2023-12-02  0:08 ` [RFC PATCH 4/5] selftests/damon: add a test for update_schemes_tried_regions sysfs command SeongJae Park
2023-12-02  0:08 ` [RFC PATCH 5/5] selftests/damon: add a test for update_schemes_tried_regions hang bug SeongJae Park

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231202000806.46210-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).