linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Quanmin Yan <yanquanmin1@huawei.com>
Cc: SeongJae Park <sj@kernel.org>,
	akpm@linux-foundation.org, damon@lists.linux.dev,
	linux-mm@kvack.org, enze.li@gmx.com, sunnanyong@huawei.com,
	Enze Li <lienze@kylinos.cn>
Subject: Re: [PATCH] mm/damon: unify address range representation with damon_addr_range
Date: Thu, 29 Jan 2026 19:38:45 -0800	[thread overview]
Message-ID: <20260130033847.52289-1-sj@kernel.org> (raw)
In-Reply-To: <71e02d8a-94b7-4b9c-877e-5efd4f7aba44@huawei.com>

Hello Quanmin,

On Fri, 30 Jan 2026 11:07:08 +0800 Quanmin Yan <yanquanmin1@huawei.com> wrote:

Thank you for jumping in and giving great comments!

> 在 2026/1/30 10:26, Quanmin Yan 写道:
> > Hi SJ,
> >
> > [...]
> >
> >> Actually, there is another bug that need to be fixed.  Nonetheless, 
> >> that's
> >> orthogonal to this patch, so it is not a blocker of this patch in my 
> >> opinion.
> >
> > Are you referring to the scenario where, on a 32-bit system with LPAE 
> > support, the biggest System RAM address found exceeds the range of 
> > unsigned long? Actually, DAMON only actively searches for the biggest 
> > System RAM address when the user does not set a monitoring region. In 
> > this case, we always reset addr_unit to 1, which essentially restricts 
> > DAMON’s monitorable address range to 0–UL. Therefore, the described 
> > situation does not occur. For details, please refer to commit [1]. 
> > However, we could perhaps further optimize this by finding any biggest 
> > System RAM address, setting damon_addr_range, and dynamically 
> > adjusting addr_unit. However, there are currently no specific 
> > requirements for this, so this work has been temporarily put on hold. 
> > [1] commit dfc02531f413 ("mm/damon/reclaim: use min_sz_region for core 
> > address alignment when setting regions") Thanks, Quanmin Yan
> >
> > [...] 
> 
> (Sorry there was an issue with my email client. I am resending now.)

No worry!

> 
> Are you referring to the scenario where, on a 32-bit system with LPAE
> support, the biggest System RAM address found exceeds the range of
> unsigned long?

You are right.

> 
> Actually, DAMON only actively searches for the biggest System RAM
> address when the user does not set a monitoring region. In this case,
> we always reset addr_unit to 1, which essentially restricts DAMON’s
> monitorable address range to 0–UL. Therefore, the described situation
> does not occur. For details, please refer to commit [1].

Again, you are correct.  There is no user scenario that can trigger the
problematic situation in the real world.  Nevertheless, assigning
'resource_size_t' value to 'unsigned long' storage makes no sense, so I'm
calling such things a bug.  Not impacting user world, but still a bug is a bug.
In my opinion, all bugs are better to be fixed unless it makes maintenance
overhead increased too much.  Also, who knows if I will introduce another code
calling it with >1 add_unit.

> 
> However, we could perhaps further optimize this by finding any biggest
> System RAM address, setting damon_addr_range, and dynamically adjusting
> addr_unit.

I agree.  I think we can fix the function first, and later consider further
allowing users to use its full power.

> However, there are currently no specific requirements for
> this, so this work has been temporarily put on hold.

You are right.  As long as there is no requirements, there is no reason to
expose the full power to users at the moment.

By the way, one thing that may better to be clear is that I requested you to
make the implementation in this way.  Nobody should be blamed, but if someone
has to be blamed for the current shape of the code, it is only me. :)

> 
> [1] commit dfc02531f413 ("mm/damon/reclaim: use min_sz_region for core
> address alignment when setting regions")


Thanks,
SJ

[...]


  reply	other threads:[~2026-01-30  3:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 10:08 Enze Li
2026-01-29 16:10 ` SeongJae Park
2026-01-30  2:26   ` Quanmin Yan
2026-01-30  3:07     ` Quanmin Yan
2026-01-30  3:38       ` SeongJae Park [this message]
2026-01-31  1:56         ` 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=20260130033847.52289-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=enze.li@gmx.com \
    --cc=lienze@kylinos.cn \
    --cc=linux-mm@kvack.org \
    --cc=sunnanyong@huawei.com \
    --cc=yanquanmin1@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox