From: SJ Park <sj@kernel.org>
To: Enze Li <lienze@kylinos.cn>
Cc: SJ Park <sj@kernel.org>,
damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, enze.li@gmx.com
Subject: Re: [PATCH v2] samples/damon/mtier: use damon_addr_range consistently
Date: Mon, 20 Jul 2026 18:28:00 -0700 [thread overview]
Message-ID: <20260721012801.94223-1-sj@kernel.org> (raw)
In-Reply-To: <20260720130642.508355-1-lienze@kylinos.cn>
Hello Enze,
On Mon, 20 Jul 2026 21:06:42 +0800 Enze Li <lienze@kylinos.cn> wrote:
> The DAMON provides struct damon_addr_range for unified address range
> management. However, the mtier sample still defines a local struct
> region_range and mixes its usage with struct damon_addr_range in
> damon_sample_mtier_build_ctx().
damon_addr_range is for DAMON core layer address system that uses 'unsigned
long' as the address type. Because 'mtier' is dealing directly with physical
address, we use a dedicated struct for that purpose. On 32bit systems having
more than 4 GiB memory, this may be necessary.
'mtier' doesn't really take care of the >4GiB 32bit system since it is simply
casting the 'phys_addr_t' addresses into 'unsigned long' addresses. But it
might support it better in future, using the addr_unit parameter.
>
> This patch removes the local struct region_range and changes the
> parameter type of nid_to_phys() to struct damon_addr_range. It also
> gets rid of the now-redundant local variable and pass the address range
> directly to damon_set_regions().
So, I don't think this change is required as-is. I don't really want to add
addr_unit support for >4GiB 32bit system, either, unless it turns out to be
really needed. I'd like to keep sample modules as simple as possible. If the
code was confusing you because it is anyway casting the types, adding a comment
explaining the rationale might be a better change, in my opinion.
Thanks,
SJ
[...]
next prev parent reply other threads:[~2026-07-21 1:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 13:06 [PATCH v2] samples/damon/mtier: use damon_addr_range consistently Enze Li
2026-07-21 1:28 ` SJ Park [this message]
2026-07-21 6:33 ` Enze Li
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=20260721012801.94223-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=damon@lists.linux.dev \
--cc=enze.li@gmx.com \
--cc=lienze@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--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