Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [RFC PATCH 0/9] mm/damon: cleanup, clarify, and add/improve test
@ 2026-09-12 20:08 SJ Park
  2026-09-12 20:08 ` [RFC PATCH 7/9] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak SJ Park
  2026-09-12 20:08 ` [RFC PATCH 8/9] mm/damon/tests/core-kunit: test eligible_mem_bp commitment SJ Park
  0 siblings, 2 replies; 3+ messages in thread
From: SJ Park @ 2026-09-12 20:08 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 DAMON overall cleanup.

SJ Park (9):
  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: use damos_quota_is_set() in damos_adjust_quota()
  mm/damon/core: document damon_call()/damon_start() race hang issue
  mm/damon/paddr: remove pa parameter from damon_pa_filter_pass()
  selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak
  mm/damon/tests/core-kunit: test eligible_mem_bp commitment
  Docs/mm/damon/design: clarify bp is basis point

 Documentation/mm/damon/design.rst                |  5 +++--
 include/linux/damon.h                            |  2 --
 mm/damon/core.c                                  | 16 ++++++----------
 mm/damon/paddr.c                                 |  5 ++---
 mm/damon/tests/core-kunit.h                      | 10 ++++++++++
 .../selftests/damon/sysfs_memcg_path_leak.sh     |  7 +++++++
 6 files changed, 28 insertions(+), 17 deletions(-)


base-commit: f0cc06ae989195d7280e0e7eff9d963ddc056d27
-- 
2.47.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [RFC PATCH 7/9] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak
  2026-09-12 20:08 [RFC PATCH 0/9] mm/damon: cleanup, clarify, and add/improve test SJ Park
@ 2026-09-12 20:08 ` SJ Park
  2026-09-12 20:08 ` [RFC PATCH 8/9] mm/damon/tests/core-kunit: test eligible_mem_bp commitment SJ Park
  1 sibling, 0 replies; 3+ messages in thread
From: SJ Park @ 2026-09-12 20:08 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..6c2d8bb3fe570 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; apparenty not from DAMON, though"
+	echo "$kmemleak_report"
+	exit 0
+fi
+
 echo "$kmemleak_report"
 exit 1
-- 
2.47.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [RFC PATCH 8/9] mm/damon/tests/core-kunit: test eligible_mem_bp commitment
  2026-09-12 20:08 [RFC PATCH 0/9] mm/damon: cleanup, clarify, and add/improve test SJ Park
  2026-09-12 20:08 ` [RFC PATCH 7/9] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak SJ Park
@ 2026-09-12 20:08 ` SJ Park
  1 sibling, 0 replies; 3+ messages in thread
From: SJ Park @ 2026-09-12 20:08 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 5e8ead5ef8728..c2da4a3fbcafb 100644
--- a/mm/damon/tests/core-kunit.h
+++ b/mm/damon/tests/core-kunit.h
@@ -836,6 +836,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;
 	}
@@ -900,6 +903,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] 3+ messages in thread

end of thread, other threads:[~2026-09-12 20:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-12 20:08 [RFC PATCH 0/9] mm/damon: cleanup, clarify, and add/improve test SJ Park
2026-09-12 20:08 ` [RFC PATCH 7/9] selftests/damon/sysfs_memcg_path_leak: fail only for real DAMON leak SJ Park
2026-09-12 20:08 ` [RFC PATCH 8/9] mm/damon/tests/core-kunit: test eligible_mem_bp commitment SJ Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox