From: Enze Li <lienze@kylinos.cn>
To: SJ Park <sj@kernel.org>
Cc: 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: Tue, 21 Jul 2026 14:33:22 +0800 [thread overview]
Message-ID: <04c66a8e-a342-427d-afa5-aede30a4df2c@kylinos.cn> (raw)
In-Reply-To: <20260721012801.94223-1-sj@kernel.org>
Hi SJ,
On 7/21/26 9:28 AM, SJ Park wrote:
> 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 for the explanation and the feedback -- I agree that keeping
struct region_range is the right call. Per your suggestion, I've
prepared a new patch that simply adds a comment to clarify the rationale.
Best Regards,
Enze
<...>
prev parent reply other threads:[~2026-07-21 6:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 13:06 Enze Li
2026-07-21 1:28 ` SJ Park
2026-07-21 6:33 ` Enze Li [this message]
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=04c66a8e-a342-427d-afa5-aede30a4df2c@kylinos.cn \
--to=lienze@kylinos.cn \
--cc=damon@lists.linux.dev \
--cc=enze.li@gmx.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sj@kernel.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
all inboxes | Powered by JetHome®