From: SJ Park <sj@kernel.org>
To: Sailesh Nandanavanam <saileshnandanavanam@gmail.com>
Cc: SJ Park <sj@kernel.org>,
damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] mm/damon/tests/core-kunit: add test for damon_call() with repeat control
Date: Tue, 17 Nov 2026 17:46:32 -0800 [thread overview]
Message-ID: <20261118014632.95656-1-sj@kernel.org> (raw)
In-Reply-To: <20261117174834.29182-1-saileshnandanavanam@gmail.com>
On Tue, 17 Nov 2026 23:18:34 +0530 Sailesh Nandanavanam <saileshnandanavanam@gmail.com> wrote:
> When call_controls_obsolete is unset and damon_call_control->repeat is
> set, damon_call() should queue the request and return 0 immediately
> without waiting for kdamond to handle it. Add a kunit test for that.
Apparently this patch was meant to be sent as a part of a series with another
patch [1] but individually sent by a setup failure. As a result, this patch is
not reviewed by Sashiko. Could you please repost as the series?
>
> Signed-off-by: Sailesh Nandanavanam <saileshnandanavanam@gmail.com>
> ---
> mm/damon/tests/core-kunit.h | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/mm/damon/tests/core-kunit.h b/mm/damon/tests/core-kunit.h
> index 13315291f69f..bc93677487b5 100644
> --- a/mm/damon/tests/core-kunit.h
> +++ b/mm/damon/tests/core-kunit.h
> @@ -2499,6 +2499,30 @@ static void damon_test_call_controls_obsolete(struct kunit *test)
> damon_destroy_ctx(ctx);
> }
>
> +static void damon_test_call_repeat(struct kunit *test)
> +{
> + struct damon_ctx *ctx;
> + struct damon_call_control control = {};
> + int ret;
> +
> + ctx = damon_new_ctx();
> +
> + if (!ctx)
> + kunit_skip(test, "ctx alloc fail");
> +
> + ctx->call_controls_obsolete = false;
> + control.repeat = true;
> +
> + ret = damon_call(ctx, &control);
> +
> + KUNIT_EXPECT_EQ(test, ret, 0);
> + KUNIT_EXPECT_FALSE(test, list_empty(&ctx->call_controls));
> + KUNIT_EXPECT_PTR_EQ(test, ctx->call_controls.next, &control.list);
I think the above last two expects are somewhat too much implementation detail.
I don't think we are promising those list status. I'd prefer dropping those.
> +
> + list_del(&control.list);
Can anything leak or corrupted if we don't call list_del() here?
> + damon_destroy_ctx(ctx);
> +}
> +
> static struct kunit_case damon_test_cases[] = {
> KUNIT_CASE(damon_test_target),
> KUNIT_CASE(damon_test_regions),
> @@ -2544,6 +2568,7 @@ static struct kunit_case damon_test_cases[] = {
> KUNIT_CASE(damos_test_esz_goal_temporal),
> KUNIT_CASE(damon_test_last_region_quota_reset),
> KUNIT_CASE(damon_test_call_controls_obsolete),
> + KUNIT_CASE(damon_test_call_repeat),
Could we merge the above two tests into one, say, damon_test_call()?
[1] https://lore.kernel.org/20261117172219.26725-1-saileshnandanavanam@gmail.com
Thanks,
SJ
[...]
next prev parent reply other threads:[~2026-11-18 1:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 17:48 [PATCH 2/2] mm/damon/tests/core-kunit: add test for damon_call() with repeat control Sailesh Nandanavanam
2026-11-18 1:46 ` SJ Park [this message]
2026-11-18 6:02 ` Sailesh-003
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=20261118014632.95656-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=saileshnandanavanam@gmail.com \
/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.