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/12] mm/damon/tests/core-kunit: test overlapping ranges for set_regions()
Date: Tue, 1 Sep 2026 22:47:41 -0700 [thread overview]
Message-ID: <20260902054747.99370-9-sj@kernel.org> (raw)
In-Reply-To: <20260902054747.99370-1-sj@kernel.org>
Commit 954157679ec3 ("mm/damon/core: disallow overlapping input ranges
for damon_set_regions()") disallowed passing overlapping input ranges to
damon_set_regions(). Add a kunit test case for the overlapping input.
Signed-off-by: SJ Park <sj@kernel.org>
---
mm/damon/tests/core-kunit.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h
index 3cbbbcbfbef8f..a4164ac489a61 100644
--- a/mm/damon/tests/core-kunit.h
+++ b/mm/damon/tests/core-kunit.h
@@ -612,6 +612,17 @@ static void damon_test_set_regions(struct kunit *test)
{.start = 42, .end = 21},
}, 1, 1,
(struct damon_addr_range[]){}, 0, -EINVAL);
+ /*
+ * Regions resulting in same region after alignment should return
+ * -EINVAL.
+ */
+ damon_test_set_regions_for(test,
+ (struct damon_addr_range[]){}, 0,
+ (struct damon_addr_range[]){
+ {.start = 10, .end = 20},
+ {.start = 20, .end = 30},
+ }, 2, 4096,
+ (struct damon_addr_range[]){}, 0, -EINVAL);
}
static void damon_test_update_monitoring_result(struct kunit *test)
--
2.47.3
next prev parent reply other threads:[~2026-09-02 5:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 5:47 [PATCH 00/12] mm/damon: cleanup code, add test cases, and update guidances in docs SJ Park
2026-09-02 5:47 ` [PATCH 06/12] mm/damon/tests/core-kunit: extend set_regions() test for error case SJ Park
2026-09-02 5:47 ` [PATCH 07/12] mm/damon/tests/core-kunit: test <=0 size damon_set_regions() inputs SJ Park
2026-09-02 5:47 ` SJ Park [this message]
2026-09-03 3:04 ` [PATCH 08/12] mm/damon/tests/core-kunit: test overlapping ranges for set_regions() Kunwu Chan
2026-09-02 5:47 ` [PATCH 09/12] mm/damon/tests/core-kunit: test damon_nr_samples_per_aggr() SJ Park
2026-09-02 15:08 ` Kunwu Chan
2026-09-02 15:19 ` SJ Park
2026-09-02 15:49 ` Kunwu Chan
2026-09-03 0:22 ` SJ Park
2026-09-02 5:47 ` [PATCH 10/12] selftests/damon/sysfs.sh: test hugepage_mem_bp quota goal SJ Park
2026-09-03 3:06 ` Kunwu Chan
2026-09-02 6:16 ` [PATCH 00/12] mm/damon: cleanup code, add test cases, and update guidances in docs SJ Park
2026-09-02 22:42 ` 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=20260902054747.99370-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox