From: Kunwu Chan <kunwu.chan@gmail.com>
To: SJ Park <sj@kernel.org>
Cc: Kunwu Chan <kunwu.chan@gmail.com>,
Andrew Morton <akpm@linux-foundation.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: Re: [RFC PATCH 8/8] mm/damon/core-kunit: test invalid damos filter commits
Date: Mon, 14 Sep 2026 23:57:27 +0800 [thread overview]
Message-ID: <20260914155729.1518105-1-kunwu.chan@gmail.com> (raw)
In-Reply-To: <20260912191807.138502-9-sj@kernel.org>
On Sat, 12 Sep 2026 12:18:06 -0700 SJ Park <sj@kernel.org> wrote:
> Add test cases for testing the validation of damos filter arguments in
> commit time.
>
> Signed-off-by: SJ Park <sj@kernel.org>
> ---
> mm/damon/tests/core-kunit.h | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h
> index c9941f3bfb42b..5da84caf4124d 100644
> --- a/mm/damon/tests/core-kunit.h
> +++ b/mm/damon/tests/core-kunit.h
> @@ -1195,6 +1195,13 @@ static void damos_test_commit_filter(struct kunit *test)
> .allow = false,
> .sz_range = {.min = 234, .max = 345},
> }, false);
> + damos_test_commit_filter_for(test, &dst,
> + &(struct damos_filter){
> + .type = DAMOS_FILTER_TYPE_HUGEPAGE_SIZE,
> + .matching = false,
> + .allow = false,
> + .sz_range = {.min = 456, .max = 123},
> + }, true);
> damos_test_commit_filter_for(test, &dst,
> &(struct damos_filter){
> .type = DAMOS_FILTER_TYPE_UNMAPPED,
> @@ -1208,6 +1215,13 @@ static void damos_test_commit_filter(struct kunit *test)
> .allow = false,
> .addr_range = {.start = 456, .end = 567},
> }, false);
> + damos_test_commit_filter_for(test, &dst,
> + &(struct damos_filter){
> + .type = DAMOS_FILTER_TYPE_ADDR,
> + .matching = false,
> + .allow = false,
> + .addr_range = {.start = 567, .end = 456},
> + }, true);
Could we also test an invalid PROBE_HITS_WSUM range here?
Patch 4 adds the same max < min validation for
DAMOS_FILTER_TYPE_PROBE_HITS_WSUM, but this test only covers
ADDR and HUGEPAGE_SIZE.
Thanks,
Kunwu
> damos_test_commit_filter_for(test, &dst,
> &(struct damos_filter){
> .type = DAMOS_FILTER_TYPE_TARGET,
> --
> 2.47.3
>
Sent using hkml (https://github.com/sjp38/hackermail)
next prev parent reply other threads:[~2026-09-14 15:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-12 19:17 [RFC PATCH 0/8] mm/damon: move damos filter range arguments validation to core SJ Park
2026-09-12 19:17 ` [RFC PATCH 1/8] mm/damon/sysfs-schemes: read sysfs_filter->addr_range only once SJ Park
2026-09-12 19:18 ` [RFC PATCH 2/8] mm/damon/sysfs-schemes: read sysfs_filter->sz_range " SJ Park
2026-09-12 19:18 ` [RFC PATCH 3/8] mm/damon/core: return an error from damos_commit_filter_arg() SJ Park
2026-09-12 19:18 ` [RFC PATCH 4/8] mm/damon/core: disallow max < min damos filter range arguments commit SJ Park
2026-09-12 19:18 ` [RFC PATCH 5/8] mm/damon/sysfs-schemes: drop centralized filter range arg validations SJ Park
2026-09-12 19:18 ` [RFC PATCH 6/8] mm/damon/sysfs-schemes: use switch-case in add_scheme_filters() SJ Park
2026-09-12 19:18 ` [RFC PATCH 7/8] mm/damon/core-kunit: extend damos_commit_filter_for() for wrong input SJ Park
2026-09-12 19:18 ` [RFC PATCH 8/8] mm/damon/core-kunit: test invalid damos filter commits SJ Park
2026-09-14 15:57 ` Kunwu Chan [this message]
2026-09-14 23:49 ` SJ Park
2026-09-15 2:39 ` KunWu Chan
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=20260914155729.1518105-1-kunwu.chan@gmail.com \
--to=kunwu.chan@gmail.com \
--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 \
--cc=sj@kernel.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
all inboxes | Powered by JetHome®