Skip to content

RFC mm/damon: minor improvements for code readability and tests

SeongJae Park damon linux-kselftest linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest14 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/14mm/damon/core: safely handle no region case in damon_set_regions()mm/damon/core.c+13 -02 replies
2/14mm/damon/core: do not use region out of a loop in damon_set_regions()mm/damon/core.c+9 -20 replies
3/14samples/damon/mtier: replace damon_add_region() with damon_set_regions()samples/damon/mtier.c+6 -40 replies
4/14mm/damon/tests/vaddr-kunit: replace damon_add_region() with damon_set_regions()mm/damon/tests/vaddr-kunit.h+20 -70 replies
5/14mm/damon/core: hide damon_add_region()include/linux/damon.h mm/damon/core.c+1 -20 replies
6/14mm/damon/core: hide damon_insert_region()include/linux/damon.h mm/damon/core.c+11 -110 replies
7/14mm/damon/core: hide damon_destroy_region()include/linux/damon.h mm/damon/core.c+2 -20 replies
8/14mm/damon/core: add kdamond_call() debug_sanity checkmm/damon/core.c+33 -00 replies
9/14mm/damon/core: remove damon_verify_nr_regions()mm/damon/core.c+0 -190 replies
10/14mm/damon/tests/core-kunit: add damon_set_regions() test casesmm/damon/tests/core-kunit.h+120 -220 replies
11/14selftests/damon/sysfs.py: stop kdamonds before failingtools/testing/selftests/damon/sysfs.py+4 -00 replies
12/14selftests/damon/sysfs.sh: test monitoring intervals goal dirtools/testing/selftests/damon/sysfs.sh+12 -00 replies
13/14selftests/damon/sysfs.sh: test addr_unit file existencetools/testing/selftests/damon/sysfs.sh+1 -00 replies
14/14selftests/damon/sysfs.sh: test pause file existencetools/testing/selftests/damon/sysfs.sh+1 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH v1.2 00/14] mm/damon: minor improvements for code readability and tests

Implement minor improvements on code readability and tests for DAMON.

First seven patches are for DAMON code readability and resulting maintenance. Patches 1 and 2 make damon_set_regions() safer and easier to read. Patches 3 and 4 remove fragmented DAMON API use cases. Patches 5-7 hides unused core functions that are unnecessarily exposed to API callers.

The following seven patches are for DAMON tests improvement. Patches 8 and 9 adds and removes DAMON_DEBUG_SANITY verifications to ensure reasonable test coverage without too high overhead. Patch 10 adds a new kunit test for damon_set_regions(). Patch 11 makes sysfs.py selftest more gracefully finishes under test failures. Patches 12-13 adds simple sysfs.sh test cases for the monitoring intervals goal directory, the addr_unit file and the pause file.

Changes from RFC v1.1
- RFC v1.1: https://lore.kernel.org/[email protected]
- Free DAMON target in vaddr unit test fail-out path. Changes from RFC v1
- RFC v1: https://lore.kernel.org/[email protected]
- Handle damon_set_regions() failure in vaddr unit test.
- Free ranges array in vaddr unit test.
- Fix wrong region address verification.
- Fix typos in selftest: s/exit/exist/

SeongJae Park (14):
mm/damon/core: safely handle no region case in damon_set_regions() mm/damon/core: do not use region out of a loop in damon_set_regions() samples/damon/mtier: replace damon_add_region() with
damon_set_regions()
mm/damon/tests/vaddr-kunit: replace damon_add_region() with
damon_set_regions()
mm/damon/core: hide damon_add_region()
mm/damon/core: hide damon_insert_region()
mm/damon/core: hide damon_destroy_region()
mm/damon/core: add kdamond_call() debug_sanity check mm/damon/core: remove damon_verify_nr_regions() mm/damon/tests/core-kunit: add damon_set_regions() test cases selftests/damon/sysfs.py: stop kdamonds before failing selftests/damon/sysfs.sh: test monitoring intervals goal dir selftests/damon/sysfs.sh: test addr_unit file existence selftests/damon/sysfs.sh: test pause file existence

 include/linux/damon.h                  |  13 ---
 mm/damon/core.c                        |  92 ++++++++++++----
 mm/damon/tests/core-kunit.h            | 142 +++++++++++++++++++++----
 mm/damon/tests/vaddr-kunit.h           |  27 +++--
 samples/damon/mtier.c                  |  10 +-
 tools/testing/selftests/damon/sysfs.py |   4 +
 tools/testing/selftests/damon/sysfs.sh |  14 +++
 7 files changed, 233 insertions(+), 69 deletions(-)

base-commit: ac6b83c7bf3671e8ff0d541cf03e6eaeed00a79e

Signature · 1 line
2.47.3