DAMON development mailing list
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Zenghui Yu" <zenghui.yu@linux.dev>
Cc: damon@lists.linux.dev
Subject: Re: [PATCH] mm/damon/core: remove declaration of kdamond_fn()
Date: Thu, 27 Aug 2026 16:48:22 +0000	[thread overview]
Message-ID: <20260827164822.D80F21F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260827163953.83520-1-zenghui.yu@linux.dev>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Removing the forward declaration of `kdamond_fn` causes a build failure because it is referenced in `__damon_start` before its definition.
--

commit 38eba93e0517bb327a80a5c61f1f8b5a41ec274d
Author: Zenghui Yu (Huawei) <zenghui.yu@linux.dev>

mm/damon/core: remove declaration of kdamond_fn()

It was added by commit 2224d8485492 ("mm: introduce Data Access MONitor
(DAMON)") but is actually not needed.  Remove it.

> diff --git a/mm/damon/core.c b/mm/damon/core.c
> index 644daf5a16560..67d93b57a8947 100644
> --- a/mm/damon/core.c
> +++ b/mm/damon/core.c
> @@ -1922,8 +1922,6 @@ static unsigned long damon_apply_min_nr_regions(struct damon_ctx *ctx)
>  	return max_region_sz;
>  }
>  
> -static int kdamond_fn(void *data);
> -

[Severity: Low]
Does removing this forward declaration cause a build failure?

It looks like kdamond_fn is referenced shortly after in __damon_start(), but
its actual definition doesn't occur until much later in the file:

mm/damon/core.c:__damon_start() {
        ...
		ctx->kdamond = kthread_run(kdamond_fn, ctx, "kdamond.%d",
				nr_running_ctxs);
        ...
}

Will the compiler fail when compiling mm/damon/core.c because kdamond_fn is
used before it is defined?

>  /*
>   * __damon_start() - Starts monitoring with given context.
>   * @ctx:	monitoring context

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260827163953.83520-1-zenghui.yu@linux.dev?part=1

  parent reply	other threads:[~2026-08-27 16:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27 16:39 [PATCH] mm/damon/core: remove declaration of kdamond_fn() Zenghui Yu
2026-08-27 16:47 ` Zenghui Yu
2026-08-28  1:01   ` SJ Park
2026-08-27 16:48 ` sashiko-bot [this message]
2026-08-28  0:54 ` kernel test robot
2026-08-28  5:33 ` kernel test robot

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=20260827164822.D80F21F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=damon@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=zenghui.yu@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