DAMON development mailing list
 help / color / mirror / Atom feed
From: SJ Park <sj@kernel.org>
To: sashiko-bot@kernel.org
Cc: SJ Park <sj@kernel.org>, damon@lists.linux.dev
Subject: Re: [PATCH 8/8] mm/damon/core-kunit: test invalid damos filter commits
Date: Mon, 14 Sep 2026 16:42:24 -0700	[thread overview]
Message-ID: <20260914234226.99997-1-sj@kernel.org> (raw)
In-Reply-To: <20260914154459.6CF891F00893@smtp.kernel.org>

On Mon, 14 Sep 2026 15:44:58 +0000 sashiko-bot@kernel.org wrote:

> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] Missing test coverage for invalid DAMOS_FILTER_TYPE_PROBE_HITS_WSUM filter commits.
> --
> 
> commit 3dd853ee9735627ad90ea3f3d15874f043b5bdb4
> Author: SJ Park <sj@kernel.org>
> 
> mm/damon/core-kunit: test invalid damos filter commits
>     
> This commit adds test cases to verify the validation of damos filter arguments
> at commit time.
> 
> > diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h
> > index 2b0931cf6fb32..527abc2570616 100644
> > --- a/mm/damon/tests/core-kunit.h
> > +++ b/mm/damon/tests/core-kunit.h
> > @@ -1184,6 +1184,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);
> 
> [ ... ]
> 
> > @@ -1197,6 +1204,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);
> 
> [Severity: Low]
> This isn't a bug, but is a test needed here for
> DAMOS_FILTER_TYPE_PROBE_HITS_WSUM?
> 
> This patch adds negative tests expecting failure for invalid filter arguments
> using DAMOS_FILTER_TYPE_HUGEPAGE_SIZE and DAMOS_FILTER_TYPE_ADDR.
> 
> Because DAMOS_FILTER_TYPE_PROBE_HITS_WSUM uses identical validation logic in
> damos_commit_filter_arg() that rejects arguments when range_max is less than
> range_min, should a similar test be added to provide equivalent coverage?
> 
> Also, earlier in this file, damos_test_commit_filter_for() validates
> successful copies for other types, but lacks a case to check range_min and
> range_max for PROBE_HITS_WSUM. Would it make sense to add validation for this
> filter type there as well?

It makes sense to add the test.  But not necessarily a blocker of this patch.
I will separately work on the test.

> 
> -- 
> Sashiko AI review · https://sashiko.dev/#/patchset/20260914142327.92510-1-sj@kernel.org?part=8


Thanks,
SJ

  reply	other threads:[~2026-09-14 23:42 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-14 14:23 [PATCH 0/8] mm/damon: move damos filter range arguments validation to core SJ Park
2026-09-14 14:23 ` [PATCH 1/8] mm/damon/sysfs-schemes: read sysfs_filter->addr_range only once SJ Park
2026-09-14 14:44   ` sashiko-bot
2026-09-14 14:23 ` [PATCH 2/8] mm/damon/sysfs-schemes: read sysfs_filter->sz_range " SJ Park
2026-09-14 14:57   ` sashiko-bot
2026-09-14 14:23 ` [PATCH 3/8] mm/damon/core: return an error from damos_commit_filter_arg() SJ Park
2026-09-14 15:04   ` sashiko-bot
2026-09-14 14:23 ` [PATCH 4/8] mm/damon/core: disallow max < min damos filter range arguments commit SJ Park
2026-09-14 15:13   ` sashiko-bot
2026-09-14 14:23 ` [PATCH 5/8] mm/damon/sysfs-schemes: drop centralized filter range arg validations SJ Park
2026-09-14 15:26   ` sashiko-bot
2026-09-14 14:23 ` [PATCH 6/8] mm/damon/sysfs-schemes: use switch-case in add_scheme_filters() SJ Park
2026-09-14 15:31   ` sashiko-bot
2026-09-14 14:23 ` [PATCH 7/8] mm/damon/core-kunit: extend damos_commit_filter_for() for wrong input SJ Park
2026-09-14 15:36   ` sashiko-bot
2026-09-14 14:23 ` [PATCH 8/8] mm/damon/core-kunit: test invalid damos filter commits SJ Park
2026-09-14 15:44   ` sashiko-bot
2026-09-14 23:42     ` SJ Park [this message]
2026-09-14 23:43 ` [PATCH 0/8] mm/damon: move damos filter range arguments validation to core SJ Park

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=20260914234226.99997-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=damon@lists.linux.dev \
    --cc=sashiko-bot@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