[PATCH 00/14] mm/damon: minor improvements for code readability and tests

SeongJae Park posted 14 patches 2 days, 3 hours ago
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(-)
[PATCH 00/14] mm/damon: minor improvements for code readability and tests
Posted by SeongJae Park 2 days, 3 hours ago
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.

Chagens from RFC v1.2
- RFC v1.2: https://lore.kernel.org/20260521143428.83157-1-sj@kernel.org
- Drop RFC.
- Rebase to latest mm-new.
Changes from RFC v1.1
- RFC v1.1: https://lore.kernel.org/20260521035349.87565-1-sj@kernel.org
- Free DAMON target in vaddr unit test fail-out path.
Changes from RFC v1
- RFC v1: https://lore.kernel.org/20260520062858.167011-1-sj@kernel.org
- 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: 712074729b7852a468166a84b131ca9f12680629
-- 
2.47.3
Re: [PATCH 00/14] mm/damon: minor improvements for code readability and tests
Posted by SeongJae Park 1 day, 23 hours ago
Dropped individual recipients except Andrew.

On Fri, 22 May 2026 08:40:11 -0700 SeongJae Park <sj@kernel.org> wrote:

> Implement minor improvements on code readability and tests for DAMON.

Sashiko failed reviewing this completely, but found no blockers.  Also it
didn't find a blocker from the previous version of this series, which is same
to this version except the baseline commit.

[1] https://sashiko.dev/#/patchset/20260522154026.80546-1-sj%40kernel.org


Thanks,
SJ

[...]
Re: [PATCH 00/14] mm/damon: minor improvements for code readability and tests
Posted by Andrew Morton 1 day, 23 hours ago
On Fri, 22 May 2026 13:13:52 -0700 SeongJae Park <sj@kernel.org> wrote:

> Dropped individual recipients except Andrew.

Re-added them ;)

> On Fri, 22 May 2026 08:40:11 -0700 SeongJae Park <sj@kernel.org> wrote:
> 
> > Implement minor improvements on code readability and tests for DAMON.
> 
> Sashiko failed reviewing this completely, but found no blockers.  Also it
> didn't find a blocker from the previous version of this series, which is same
> to this version except the baseline commit.
> 
> [1] https://sashiko.dev/#/patchset/20260522154026.80546-1-sj%40kernel.org

OK, thanks for checking - I'll add this series to mm.git's mm-new
branch.