DAMON development mailing list
 help / color / mirror / Atom feed
From: Liew Rui Yan <aethernet65535@gmail.com>
To: sashiko-bot@kernel.org
Cc: aethernet65535@gmail.com, damon@lists.linux.dev,
	sashiko-reviews@lists.linux.dev
Subject: Re: [PATCH] mm/damon/tests/core-kunit: add test for unconditionally skipping the last region
Date: Mon, 31 Aug 2026 20:28:15 +0800	[thread overview]
Message-ID: <20260831122842.9091-1-aethernet65535@gmail.com> (raw)
In-Reply-To: <20260831115015.3A53C1F000E9@smtp.kernel.org>

On Mon, 31 Aug 2026 11:50:14 +0000 sashiko-bot@kernel.org wrote:

> commit 7f67629ee782b9649498afa3088f50459bfb8f3b
> Author: Liew Rui Yan <aethernet65535@gmail.com>
> 
> mm/damon/tests/core-kunit: add test for unconditionally skipping the last region
> 
> This commit introduces a KUnit test to verify that the last region is not
> skipped before being processed.
> 
> > diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h
> > index 4a536d41cdb2d..90b0fda34fba2 100644
> > --- a/mm/damon/tests/core-kunit.h
> > +++ b/mm/damon/tests/core-kunit.h
> [ ... ]
> > @@ -1632,6 +1632,48 @@ static void damon_test_rand(struct kunit *test)
> >  	}
> >  }
> >  
> > +static void damon_test_last_region_quota_reset(struct kunit *test)
> > +{
> > +	struct damos s = {0};
> > +	struct damon_target *t;
> > +	struct damon_region *r1, *r2;
> > +	unsigned long min_region_sz = 10;
> > +	bool skipped;
> [ ... ]
> > +	s.quota.charge_target_from = t;
> > +	s.quota.charge_addr_from = r1->ar.end;
> > +
> > +	skipped = damos_skip_charged_region(t, r2, &s, min_region_sz);
> > +
> > +	/* 'r2' is not processed, it should not skip */
> > +	KUNIT_EXPECT_EQ(test, skipped, false);
> 
> [Severity: Medium]
> Does this patch omit the fix for the core logic?
> 
> Without an accompanying fix for damos_skip_charged_region() in
> mm/damon/core.c, won't this new test unconditionally fail and break CI?
> 
> Because the underlying bug is not fixed in this patch, the old logic still
> triggers and returns true when it processes the last region:
> 
> mm/damon/core.c:damos_skip_charged_region() {
> 	...
> 	if (quota->charge_target_from) {
> 		if (t != quota->charge_target_from)
> 			return true;
> 		if (r == damon_last_region(t)) {
> 			quota->charge_target_from = NULL;
> 			quota->charge_addr_from = 0;
> 			return true;
> 		}
> 	...
> }

This test is add for [1].  Therefore, this patch can only be merged
after [1] is merged.

[1] https://lore.kernel.org/damon/20260830063159.6347-1-aethernet65535@gmail.com

Best regards,
Rui Yan

  reply	other threads:[~2026-08-31 12:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 11:37 [PATCH] mm/damon/tests/core-kunit: add test for unconditionally skipping the last region Liew Rui Yan
2026-08-31 11:50 ` sashiko-bot
2026-08-31 12:28   ` Liew Rui Yan [this message]
2026-09-01  0:25     ` SJ Park
2026-09-01  0:55       ` Liew Rui Yan

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=20260831122842.9091-1-aethernet65535@gmail.com \
    --to=aethernet65535@gmail.com \
    --cc=damon@lists.linux.dev \
    --cc=sashiko-bot@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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