* [RFC PATCH v2 00/10] mm/damon: improve readability, clarity and test coverage
@ 2026-09-17 4:05 SJ Park
2026-09-17 4:05 ` [RFC PATCH v2 07/10] mm/damon/tests/core-kunit: test eligible_mem_bp commitment SJ Park
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: SJ Park @ 2026-09-17 4:05 UTC (permalink / raw)
Cc: SJ Park, Liam R. Howlett, Andrew Morton, Brendan Higgins,
David Gow, David Hildenbrand, Jonathan Corbet, Lorenzo Stoakes,
Michal Hocko, Mike Rapoport, Randy Dunlap, Shuah Khan, Shuah Khan,
Suren Baghdasaryan, Vlastimil Babka, damon, kunit-dev, linux-doc,
linux-kernel, linux-kselftest, linux-mm
Yet another batch of miscellaneous DAMON minor improvements. Mostly
focused on readability and clarity of code and document, and unit/self
test coverage. No user-visible behavioral change is intended.
Changes from RFC
- RFC: https://lore.kernel.org/20260912200814.145612-1-sj@kernel.org
- Fix a typo in the selftest warning message.
- Collect A-b: from Randy.
- Split out damos_adjust_quota() fix to an individual hotfix patch.
- Add a patch for initializing walk_control_obsolete in damon_new_ctx().
- Add a patch for probe_hits_wsum damos filter commit kunit test.
- Trivial patch sequence update.
- Rebase to the latest mm-new.
SJ Park (10):
mm/damon/api: remove NR_DAMOS_FILTER_TYPES
mm/damon/core: use abs_diff() in damon_feed_loop_next_input()
mm/damon/core: use mult_frac() in damon_feed_loop_next_input()
mm/damon/core: set damon_ctx->walk_control_obsolete in damon_new_ctx()
mm/damon/core: document damon_call()/damon_start() race hang issue
mm/damon/paddr: remove pa parameter from damon_pa_filter_pass()
mm/damon/tests/core-kunit: test eligible_mem_bp commitment
mm/damon/tests/core-kunit: add probe_hits_wsum damos filter commit
test
selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak
Docs/mm/damon/design: clarify bp is basis point
Documentation/mm/damon/design.rst | 5 ++--
include/linux/damon.h | 2 --
mm/damon/core.c | 19 ++++--------
mm/damon/paddr.c | 5 ++--
mm/damon/tests/core-kunit.h | 30 +++++++++++++++++++
.../selftests/damon/sysfs_memcg_path_leak.sh | 7 +++++
6 files changed, 48 insertions(+), 20 deletions(-)
base-commit: b7c76a308c2afda7cfc2ce98be3eed466be71337
--
2.47.3
^ permalink raw reply [flat|nested] 4+ messages in thread* [RFC PATCH v2 07/10] mm/damon/tests/core-kunit: test eligible_mem_bp commitment 2026-09-17 4:05 [RFC PATCH v2 00/10] mm/damon: improve readability, clarity and test coverage SJ Park @ 2026-09-17 4:05 ` SJ Park 2026-09-17 4:05 ` [RFC PATCH v2 08/10] mm/damon/tests/core-kunit: add probe_hits_wsum damos filter commit test SJ Park 2026-09-17 4:05 ` [RFC PATCH v2 09/10] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak SJ Park 2 siblings, 0 replies; 4+ messages in thread From: SJ Park @ 2026-09-17 4:05 UTC (permalink / raw) Cc: SJ Park, Andrew Morton, Brendan Higgins, David Gow, damon, kunit-dev, linux-kernel, linux-kselftest, linux-mm There was a DAMOS quota goal commit bug [1] that doesn't update the nid field for DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP metric goal. Add a kunit test case for confirming nid commitment. [1] https://lore.kkernel.org/20260827045035.94611-1-sj@kernel.org Signed-off-by: SJ Park <sj@kernel.org> --- mm/damon/tests/core-kunit.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 82c542afaa60e..1244cfeae5e70 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -835,6 +835,9 @@ static void damos_test_commit_quota_goal_for(struct kunit *test, KUNIT_EXPECT_EQ(test, dst->nid, src->nid); KUNIT_EXPECT_EQ(test, dst->memcg_id, src->memcg_id); break; + case DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP: + KUNIT_EXPECT_EQ(test, dst->nid, src->nid); + break; default: break; } @@ -898,6 +901,13 @@ static void damos_test_commit_quota_goal(struct kunit *test) .current_value = 345, .last_psi_total = 567, }); + damos_test_commit_quota_goal_for(test, &dst, + &(struct damos_quota_goal){ + .metric = DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP, + .target_value = 12, + .current_value = 345, + .nid = 6, + }); } static void damos_test_commit_quota_goals_for(struct kunit *test, -- 2.47.3 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [RFC PATCH v2 08/10] mm/damon/tests/core-kunit: add probe_hits_wsum damos filter commit test 2026-09-17 4:05 [RFC PATCH v2 00/10] mm/damon: improve readability, clarity and test coverage SJ Park 2026-09-17 4:05 ` [RFC PATCH v2 07/10] mm/damon/tests/core-kunit: test eligible_mem_bp commitment SJ Park @ 2026-09-17 4:05 ` SJ Park 2026-09-17 4:05 ` [RFC PATCH v2 09/10] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak SJ Park 2 siblings, 0 replies; 4+ messages in thread From: SJ Park @ 2026-09-17 4:05 UTC (permalink / raw) Cc: SJ Park, Andrew Morton, Brendan Higgins, David Gow, damon, kunit-dev, linux-kernel, linux-kselftest, linux-mm DAMOS filter commit kunit test lacks test cases for probe_hits_wsum filter type. Add test cases for probe_hits_wsum type DAMOS filter commit. Signed-off-by: SJ Park <sj@kernel.org> --- mm/damon/tests/core-kunit.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h index 1244cfeae5e70..df84d9cc7d204 100644 --- a/mm/damon/tests/core-kunit.h +++ b/mm/damon/tests/core-kunit.h @@ -1166,6 +1166,10 @@ static void damos_test_commit_filter_for(struct kunit *test, KUNIT_EXPECT_EQ(test, dst->sz_range.min, src->sz_range.min); KUNIT_EXPECT_EQ(test, dst->sz_range.max, src->sz_range.max); break; + case DAMOS_FILTER_TYPE_PROBE_HITS_WSUM: + KUNIT_EXPECT_EQ(test, dst->range_min, src->range_min); + KUNIT_EXPECT_EQ(test, dst->range_max, src->range_max); + break; default: break; } @@ -1239,6 +1243,22 @@ static void damos_test_commit_filter(struct kunit *test) .allow = true, .target_idx = 6, }, false); + damos_test_commit_filter_for(test, &dst, + &(struct damos_filter){ + .type = DAMOS_FILTER_TYPE_PROBE_HITS_WSUM, + .matching = false, + .allow = true, + .range_min = 12, + .range_max = 34, + }, false); + damos_test_commit_filter_for(test, &dst, + &(struct damos_filter){ + .type = DAMOS_FILTER_TYPE_PROBE_HITS_WSUM, + .matching = false, + .allow = true, + .range_min = 34, + .range_max = 12, + }, true); } static void damos_test_help_initailize_scheme(struct damos *scheme) -- 2.47.3 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [RFC PATCH v2 09/10] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak 2026-09-17 4:05 [RFC PATCH v2 00/10] mm/damon: improve readability, clarity and test coverage SJ Park 2026-09-17 4:05 ` [RFC PATCH v2 07/10] mm/damon/tests/core-kunit: test eligible_mem_bp commitment SJ Park 2026-09-17 4:05 ` [RFC PATCH v2 08/10] mm/damon/tests/core-kunit: add probe_hits_wsum damos filter commit test SJ Park @ 2026-09-17 4:05 ` SJ Park 2 siblings, 0 replies; 4+ messages in thread From: SJ Park @ 2026-09-17 4:05 UTC (permalink / raw) Cc: SJ Park, Shuah Khan, damon, linux-kernel, linux-kselftest, linux-mm The selftest can fail for any leak if it happens while the test is running. Remove the false positive test failures by further checking if the expected leaking function is called out on the report. Signed-off-by: SJ Park <sj@kernel.org> --- tools/testing/selftests/damon/sysfs_memcg_path_leak.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh b/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh index 33a7ff43ed6cc..34c37129c49fe 100755 --- a/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh +++ b/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh @@ -41,5 +41,12 @@ if [ "$kmemleak_report" = "" ] then exit 0 fi +if ! echo "$kmemleak_report" | grep "memcg_path_store" --quiet +then + echo "[WARN] memleak found; apparently not from DAMON, though" + echo "$kmemleak_report" + exit 0 +fi + echo "$kmemleak_report" exit 1 -- 2.47.3 ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-17 4:05 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-09-17 4:05 [RFC PATCH v2 00/10] mm/damon: improve readability, clarity and test coverage SJ Park 2026-09-17 4:05 ` [RFC PATCH v2 07/10] mm/damon/tests/core-kunit: test eligible_mem_bp commitment SJ Park 2026-09-17 4:05 ` [RFC PATCH v2 08/10] mm/damon/tests/core-kunit: add probe_hits_wsum damos filter commit test SJ Park 2026-09-17 4:05 ` [RFC PATCH v2 09/10] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak SJ Park
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox