From: SeongJae Park <sj@kernel.org>
To: Enze Li <lienze@kylinos.cn>
Cc: SeongJae Park <sj@kernel.org>,
akpm@linux-foundation.org, damon@lists.linux.dev,
linux-mm@kvack.org
Subject: Re: [PATCH] mm/damon/core: Initialize sampling_addr in damon_new_region()
Date: Mon, 21 Apr 2025 09:55:25 -0700 [thread overview]
Message-ID: <20250421165526.8517-1-sj@kernel.org> (raw)
In-Reply-To: <20250421033919.404013-1-lienze@kylinos.cn>
On Mon, 21 Apr 2025 11:39:19 +0800 Enze Li <lienze@kylinos.cn> wrote:
> Since sampling_addr is used across vaddr and paddr modules, initialize
> it in damon_new_region().
>
> Signed-off-by: Enze Li <lienze@kylinos.cn>
> ---
> mm/damon/core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/mm/damon/core.c b/mm/damon/core.c
> index f0c1676f0599..d197a5e3901c 100644
> --- a/mm/damon/core.c
> +++ b/mm/damon/core.c
> @@ -128,6 +128,7 @@ struct damon_region *damon_new_region(unsigned long start, unsigned long end)
>
> region->ar.start = start;
> region->ar.end = end;
> + region->sampling_addr = 0;
> region->nr_accesses = 0;
> region->nr_accesses_bp = 0;
> INIT_LIST_HEAD(®ion->list);
I unfortunately cannot find why this is required. Is there a use case that
reads uninitialized sampling_addr or any problem that comes from the fact that
damon_new_regions() is not initializing the field?
Only operations set implementations write and read damon_region->sampling_addr,
so I was thinking not initializing the field on the core layer is no problem.
I will be happy to be corrected if I'm missing something.
Thanks,
SJ
>
> base-commit: 9d7a0577c9db35c4cc52db90bc415ea248446472
> --
> 2.43.0
next prev parent reply other threads:[~2025-04-21 16:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-21 3:39 Enze Li
2025-04-21 16:55 ` SeongJae Park [this message]
2025-04-22 6:09 ` Enze Li
2025-04-22 16:55 ` SeongJae 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=20250421165526.8517-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=lienze@kylinos.cn \
--cc=linux-mm@kvack.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