* [PATCH 00/10] mm/damon: improve readability, clarity and test coverage
@ 2026-09-17 14:21 SJ Park
2026-09-17 14:22 ` [PATCH 07/10] mm/damon/tests/core-kunit: test eligible_mem_bp commitment SJ Park
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: SJ Park @ 2026-09-17 14:21 UTC (permalink / raw)
To: Andrew Morton
Cc: SJ Park, Liam R. Howlett, 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 v2
- RFC v2: https://lore.kernel.org/20260917040537.107341-1-sj@kernel.org
- Drop RFC tag.
- Rebase to the latest mm-new.
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: 942682790e570c9422a389bf34097e74c4777fe9
--
2.47.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 07/10] mm/damon/tests/core-kunit: test eligible_mem_bp commitment
2026-09-17 14:21 [PATCH 00/10] mm/damon: improve readability, clarity and test coverage SJ Park
@ 2026-09-17 14:22 ` SJ Park
2026-09-17 14:22 ` [PATCH 08/10] mm/damon/tests/core-kunit: add probe_hits_wsum damos filter commit test SJ Park
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: SJ Park @ 2026-09-17 14:22 UTC (permalink / raw)
To: Andrew Morton
Cc: SJ Park, 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 5da84caf4124d..1f19fefdd98c3 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] 6+ messages in thread
* [PATCH 08/10] mm/damon/tests/core-kunit: add probe_hits_wsum damos filter commit test
2026-09-17 14:21 [PATCH 00/10] mm/damon: improve readability, clarity and test coverage SJ Park
2026-09-17 14:22 ` [PATCH 07/10] mm/damon/tests/core-kunit: test eligible_mem_bp commitment SJ Park
@ 2026-09-17 14:22 ` SJ Park
2026-09-17 14:22 ` [PATCH 09/10] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak SJ Park
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: SJ Park @ 2026-09-17 14:22 UTC (permalink / raw)
To: Andrew Morton
Cc: SJ Park, 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 1f19fefdd98c3..5ff0436c58441 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] 6+ messages in thread
* [PATCH 09/10] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak
2026-09-17 14:21 [PATCH 00/10] mm/damon: improve readability, clarity and test coverage SJ Park
2026-09-17 14:22 ` [PATCH 07/10] mm/damon/tests/core-kunit: test eligible_mem_bp commitment SJ Park
2026-09-17 14:22 ` [PATCH 08/10] mm/damon/tests/core-kunit: add probe_hits_wsum damos filter commit test SJ Park
@ 2026-09-17 14:22 ` SJ Park
2026-09-17 14:37 ` [PATCH 00/10] mm/damon: improve readability, clarity and test coverage SJ Park
2026-09-17 21:57 ` Andrew Morton
4 siblings, 0 replies; 6+ messages in thread
From: SJ Park @ 2026-09-17 14:22 UTC (permalink / raw)
To: Andrew Morton
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] 6+ messages in thread
* Re: [PATCH 00/10] mm/damon: improve readability, clarity and test coverage
2026-09-17 14:21 [PATCH 00/10] mm/damon: improve readability, clarity and test coverage SJ Park
` (2 preceding siblings ...)
2026-09-17 14:22 ` [PATCH 09/10] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak SJ Park
@ 2026-09-17 14:37 ` SJ Park
2026-09-17 21:57 ` Andrew Morton
4 siblings, 0 replies; 6+ messages in thread
From: SJ Park @ 2026-09-17 14:37 UTC (permalink / raw)
To: SJ Park
Cc: Andrew Morton, Liam R. Howlett, 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
On Thu, 17 Sep 2026 07:21:58 -0700 SJ Park <sj@kernel.org> wrote:
> 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.
Sashiko found no blocker for this series. Sashiko send its findings to damon@
mailing list [1], and I reply those if anything needs to be clarified. Please
refer to those for details.
[1] https://lore.kernel.org/damon/
Thanks,
SJ
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 00/10] mm/damon: improve readability, clarity and test coverage
2026-09-17 14:21 [PATCH 00/10] mm/damon: improve readability, clarity and test coverage SJ Park
` (3 preceding siblings ...)
2026-09-17 14:37 ` [PATCH 00/10] mm/damon: improve readability, clarity and test coverage SJ Park
@ 2026-09-17 21:57 ` Andrew Morton
4 siblings, 0 replies; 6+ messages in thread
From: Andrew Morton @ 2026-09-17 21:57 UTC (permalink / raw)
To: SJ Park
Cc: Liam R. Howlett, 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
On Thu, 17 Sep 2026 07:21:58 -0700 SJ Park <sj@kernel.org> wrote:
> 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.
Thanks, all queued up in mm-new.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-09-17 21:57 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-17 14:21 [PATCH 00/10] mm/damon: improve readability, clarity and test coverage SJ Park
2026-09-17 14:22 ` [PATCH 07/10] mm/damon/tests/core-kunit: test eligible_mem_bp commitment SJ Park
2026-09-17 14:22 ` [PATCH 08/10] mm/damon/tests/core-kunit: add probe_hits_wsum damos filter commit test SJ Park
2026-09-17 14:22 ` [PATCH 09/10] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak SJ Park
2026-09-17 14:37 ` [PATCH 00/10] mm/damon: improve readability, clarity and test coverage SJ Park
2026-09-17 21:57 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox