From: SeongJae Park <sj@kernel.org>
Cc: SeongJae Park <sj@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Brendan Higgins <brendan.higgins@linux.dev>,
	David Gow <davidgow@davidgow.net>, Shuah Khan <shuah@kernel.org>,
	damon@lists.linux.dev, kunit-dev@googlegroups.com,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-mm@kvack.org
Subject: [RFC PATCH v1.1 00/14] mm/damon: minor improvements for code readability and tests
Date: Wed, 20 May 2026 20:53:34 -0700	[thread overview]
Message-ID: <20260521035349.87565-1-sj@kernel.org> (raw)

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
- 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           |  24 +++--
 samples/damon/mtier.c                  |  10 +-
 tools/testing/selftests/damon/sysfs.py |   4 +
 tools/testing/selftests/damon/sysfs.sh |  14 +++
 7 files changed, 230 insertions(+), 69 deletions(-)


base-commit: ae90ad6788e582af07da1b2ce81277d5a65f4f89
-- 
2.47.3

             reply	other threads:[~2026-05-21  3:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21  3:53 SeongJae Park [this message]
2026-05-21  3:53 ` [RFC PATCH v1.1 01/14] mm/damon/core: safely handle no region case in damon_set_regions() SeongJae Park
2026-05-21  3:53 ` [RFC PATCH v1.1 02/14] mm/damon/core: do not use region out of a loop " SeongJae Park
2026-05-21  4:19   ` sashiko-bot
2026-05-21  6:05     ` SeongJae Park
2026-05-21  3:53 ` [RFC PATCH v1.1 03/14] samples/damon/mtier: replace damon_add_region() with damon_set_regions() SeongJae Park
2026-05-21  3:53 ` [RFC PATCH v1.1 04/14] mm/damon/tests/vaddr-kunit: " SeongJae Park
2026-05-21  4:05   ` sashiko-bot
2026-05-21  5:24     ` SeongJae Park
2026-05-21  3:53 ` [RFC PATCH v1.1 05/14] mm/damon/core: hide damon_add_region() SeongJae Park
2026-05-21  3:53 ` [RFC PATCH v1.1 06/14] mm/damon/core: hide damon_insert_region() SeongJae Park
2026-05-21  3:53 ` [RFC PATCH v1.1 07/14] mm/damon/core: hide damon_destroy_region() SeongJae Park
2026-05-21  3:53 ` [RFC PATCH v1.1 08/14] mm/damon/core: add kdamond_call() debug_sanity check SeongJae Park
2026-05-21  3:53 ` [RFC PATCH v1.1 09/14] mm/damon/core: remove damon_verify_nr_regions() SeongJae Park
2026-05-21  3:53 ` [RFC PATCH v1.1 10/14] mm/damon/tests/core-kunit: add damon_set_regions() test cases SeongJae Park
2026-05-21  3:53 ` [RFC PATCH v1.1 11/14] selftests/damon/sysfs.py: stop kdamonds before failing SeongJae Park
2026-05-21  3:53 ` [RFC PATCH v1.1 12/14] selftests/damon/sysfs.sh: test monitoring intervals goal dir SeongJae Park
2026-05-21  3:53 ` [RFC PATCH v1.1 13/14] selftests/damon/sysfs.sh: test addr_unit file existence SeongJae Park
2026-05-21  3:53 ` [RFC PATCH v1.1 14/14] selftests/damon/sysfs.sh: test pause " 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=20260521035349.87565-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=brendan.higgins@linux.dev \
    --cc=damon@lists.linux.dev \
    --cc=davidgow@davidgow.net \
    --cc=kunit-dev@googlegroups.com \
    --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 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.