linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: SeongJae Park <sj@kernel.org>
Cc: Quanmin Yan <yanquanmin1@huawei.com>,
	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: Wed,  4 Mar 2026 21:41:46 -0800	[thread overview]
Message-ID: <20260305054148.83837-1-sj@kernel.org> (raw)
In-Reply-To: <20260131015643.79158-1-sj@kernel.org>

On Fri, 30 Jan 2026 17:56:41 -0800 SeongJae Park <sj@kernel.org> wrote:

> On Thu, 29 Jan 2026 19:38:45 -0800 SeongJae Park <sj@kernel.org> wrote:
> 
> > Hello Quanmin,
> > 
> > On Fri, 30 Jan 2026 11:07:08 +0800 Quanmin Yan <yanquanmin1@huawei.com> wrote:
> [...]
> > > 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.
> 
> I was arguing it as a bug even though ABI users cannot trigger the overflow,
> since damon_set_region_biggest_system_ram_default() is exposed to DAMON API
> callers, and I was thinking a future caller of the function could trigger the
> problem.  But I now realize the API function is safe from any call, since
> damon_find_biggest_system_ram() is avoiding the case, by setting 'end'
> parameter of walk_system_ram_res() as 'ULONG_MAX'.  Maybe it is not really
> appropriate to call it a bug.
> 
> That said, I now think this as a room to improve for the readability of the
> code.

So, I sent an RFC patch for this:
https://lore.kernel.org/20260305053918.83786-1-sj@kernel.org


Thanks,
SJ

[...]


      reply	other threads:[~2026-03-05  5:42 UTC|newest]

Thread overview: 7+ 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
2026-01-31  1:56         ` SeongJae Park
2026-03-05  5:41           ` SeongJae Park [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=20260305054148.83837-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