All of lore.kernel.org
 help / color / mirror / Atom feed
From: SJ Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SJ Park <sj@kernel.org>,
	Brendan Higgins <brendan.higgins@linux.dev>,
	David Gow <davidgow@davidgow.net>,
	damon@lists.linux.dev, kunit-dev@googlegroups.com,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	linux-mm@kvack.org
Subject: [PATCH 08/10] mm/damon/tests/core-kunit: add probe_hits_wsum damos filter commit test
Date: Thu, 17 Sep 2026 07:22:06 -0700	[thread overview]
Message-ID: <20260917142210.90829-9-sj@kernel.org> (raw)
In-Reply-To: <20260917142210.90829-1-sj@kernel.org>

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

  parent reply	other threads:[~2026-09-17 14:22 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 14:21 [PATCH 00/10] mm/damon: improve readability, clarity and test coverage SJ Park
2026-09-17 14:21 ` [PATCH 01/10] mm/damon/api: remove NR_DAMOS_FILTER_TYPES SJ Park
2026-09-17 14:25   ` sashiko-bot
2026-09-17 14:43   ` Gutierrez Asier
2026-09-19 13:02   ` Zenghui Yu
2026-09-19 15:57     ` SJ Park
2026-09-20  1:23       ` Zenghui Yu
2026-09-17 14:22 ` [PATCH 02/10] mm/damon/core: use abs_diff() in damon_feed_loop_next_input() SJ Park
2026-09-17 14:25   ` sashiko-bot
2026-09-17 14:43   ` Gutierrez Asier
2026-09-17 14:22 ` [PATCH 03/10] mm/damon/core: use mult_frac() " SJ Park
2026-09-17 14:25   ` sashiko-bot
2026-09-17 14:44   ` Gutierrez Asier
2026-09-17 14:22 ` [PATCH 04/10] mm/damon/core: set damon_ctx->walk_control_obsolete in damon_new_ctx() SJ Park
2026-09-17 14:29   ` sashiko-bot
2026-09-17 14:22 ` [PATCH 05/10] mm/damon/core: document damon_call()/damon_start() race hang issue SJ Park
2026-09-17 14:26   ` sashiko-bot
2026-09-17 14:22 ` [PATCH 06/10] mm/damon/paddr: remove pa parameter from damon_pa_filter_pass() SJ Park
2026-09-17 14:24   ` sashiko-bot
2026-09-17 14:22 ` [PATCH 07/10] mm/damon/tests/core-kunit: test eligible_mem_bp commitment SJ Park
2026-09-17 14:26   ` sashiko-bot
2026-09-17 14:22 ` SJ Park [this message]
2026-09-17 14:26   ` [PATCH 08/10] mm/damon/tests/core-kunit: add probe_hits_wsum damos filter commit test sashiko-bot
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:31   ` sashiko-bot
2026-09-17 14:36     ` SJ Park
2026-09-17 14:22 ` [PATCH 10/10] Docs/mm/damon/design: clarify bp is basis point SJ Park
2026-09-17 14:26   ` sashiko-bot
2026-09-19 12:39   ` Zenghui Yu
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

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=20260917142210.90829-9-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 \
    /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.