summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2026-03-11 08:29:23 +0300
committerAndrew Morton <akpm@linux-foundation.org>2026-04-05 23:53:28 +0300
commitb47dcc1a28ccd5a175549055b7bc7a68a444ee92 (patch)
tree0b8c62c26deb913cc04b88db4532491e813f6aeb /include/linux
parentc63067e8b08495550be09afa646f9bf101762d0e (diff)
downloadlinux-b47dcc1a28ccd5a175549055b7bc7a68a444ee92.tar.xz
mm/damon/core: support addr_unit on damon_find_biggest_system_ram()
damon_find_biggest_system_ram() sets an 'unsigned long' variable with 'resource_size_t' value. This is fundamentally wrong. On environments such as ARM 32 bit machines having LPAE (Large Physical Address Extensions), which DAMON supports, the size of 'unsigned long' may be smaller than that of 'resource_size_t'. It is safe, though, since we restrict the walk to be done only up to ULONG_MAX. DAMON supports the address size gap using 'addr_unit'. We didn't add the support to the function, just to make the initial support change small. Now the support is reasonably settled. This kind of gap is only making the code inconsistent and easy to be confused. Add the support of 'addr_unit' to the function, by letting callers pass the 'addr_unit' and handling it in the function. All callers are passing 'addr_unit' 1, though, to keep the old behavior. [sj@kernel.org: verify found biggest system ram] Link: https://lkml.kernel.org/r/20260317144725.88524-1-sj@kernel.org Link: https://lkml.kernel.org/r/20260311052927.93921-3-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Cc: Yang yingliang <yangyingliang@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions