Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/damon/reclaim: respect addr_unit on default monitoring region setup

In the past, damon_set_region_biggest_system_ram_default(), which is the
core function for setting the default monitoring target region of
DAMON_RECLAIM, didn't support addr_unit. Hence DAMON_RECLAIM was silently
ignoring the user input for addr_unit when the user doesn't explicitly set
the monitoring target regions, and therefore the default target region is
being used. No real problem from that ignorance was reported so far.
But, the implicit rule is only making things confusing. Also, the default
target region setup function is updated to support addr_unit. Hence there
is no reason to keep ignoring it. Respect the user-passed addr_unit for
the default target monitoring region use case.

Link: https://lkml.kernel.org/r/20260311052927.93921-5-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>

authored by

SeongJae Park and committed by
Andrew Morton
fdfcda8d 5f9a5926

-6
-6
mm/damon/reclaim.c
··· 201 201 if (err) 202 202 return err; 203 203 204 - /* 205 - * If monitor_region_start/end are unset, always silently 206 - * reset addr_unit to 1. 207 - */ 208 - if (!monitor_region_start && !monitor_region_end) 209 - addr_unit = 1; 210 204 param_ctx->addr_unit = addr_unit; 211 205 param_ctx->min_region_sz = max(DAMON_MIN_REGION_SZ / addr_unit, 1); 212 206