A DAMON feature called parameters "commit" allows DAMON API callers and
ABI users to update nearly every DAMON parameter while DAMON is running.
This is being used for flexible DAMON use cases such as taking a
snapshot of the monitoring results with minimum overhead, or adjusting
access-aware system operations (DAMOS) for user-space driven auto-tuning
or investigations.
Compared to the usefulness of the feature and size of the
implementation, the test coverage is pretty small. Only the filter
commit part has a single test case, namely damos_test_commit_filter().
Actually, we found and fixed a few bugs of the feature in the past. The
single existing test was also added to avoid reintroduction of a found
bug.
Add more unit tests for the feature.
First four patches (1-4) refactor and extend the existing test for DAMOS
filter commit for multiple test cases.
Next three patches (5-7) add tests for DAMOS quota commit.
Next two patches (8 and 9) refactor damos_commit_dests() for ease of
code reading and test writing, and implement a new unit test of the
function that is being refactored in a test-friendly way.
Final two patches (10 and 11) further add new unit tests for
damos_commit() and damon_commit_target_regions().
SeongJae Park (11):
mm/damon/tests/core-kunit: remove dynamic allocs on
damos_test_commit_filter()
mm/damon/tests/core-kunit: split out damos_test_commit_filter() core
logic
mm/damon/tests/core-kunit: extend damos_test_commit_filter_for() for
union fields
mm/damon/tests/core-kunit: add test cases to
damos_test_commit_filter()
mm/damon/tests/core-kunit: add damos_commit_quota_goal() test
mm/damon/tests/core-kunit: add damos_commit_quota_goals() test
mm/damon/tests/core-kunit: add damos_commit_quota() test
mm/damon/core: pass migrate_dests to damos_commit_dests()
mm/damon/tests/core-kunit: add damos_commit_dests() test
mm/damon/tests/core-kunit: add damos_commit() test
mm/damon/tests/core-kunit: add damon_commit_target_regions() test
mm/damon/core.c | 38 ++-
mm/damon/tests/core-kunit.h | 544 +++++++++++++++++++++++++++++++++++-
2 files changed, 547 insertions(+), 35 deletions(-)
base-commit: 620a4c1c5116eb811807ea7e63d61846015f69c8
--
2.47.3