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/core: receive addr_unit on damon_set_region_biggest_system_ram_default()

damon_find_biggest_system_ram() was not supporting addr_unit in the past.
Hence, its caller, damon_set_region_biggest_system_ram_default(), was also
not supporting addr_unit. The previous commit has updated the inner
function to support addr_unit. There is no more reason to not support
addr_unit on damon_set_region_biggest_system_ram_default(). Rather, it
makes unnecessary inconsistency on support of addr_unit. Update it to
receive addr_unit and handle it inside.

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

+7 -3
+1
include/linux/damon.h
··· 994 994 995 995 int damon_set_region_biggest_system_ram_default(struct damon_target *t, 996 996 unsigned long *start, unsigned long *end, 997 + unsigned long addr_unit, 997 998 unsigned long min_region_sz); 998 999 999 1000 #endif /* CONFIG_DAMON */
+4 -3
mm/damon/core.c
··· 3110 3110 * @t: The monitoring target to set the region. 3111 3111 * @start: The pointer to the start address of the region. 3112 3112 * @end: The pointer to the end address of the region. 3113 + * @addr_unit: The address unit for the damon_ctx of @t. 3113 3114 * @min_region_sz: Minimum region size. 3114 3115 * 3115 3116 * This function sets the region of @t as requested by @start and @end. If the ··· 3123 3122 */ 3124 3123 int damon_set_region_biggest_system_ram_default(struct damon_target *t, 3125 3124 unsigned long *start, unsigned long *end, 3126 - unsigned long min_region_sz) 3125 + unsigned long addr_unit, unsigned long min_region_sz) 3127 3126 { 3128 3127 struct damon_addr_range addr_range; 3129 3128 ··· 3131 3130 return -EINVAL; 3132 3131 3133 3132 if (!*start && !*end && 3134 - !damon_find_biggest_system_ram(start, end, 1)) 3133 + !damon_find_biggest_system_ram(start, end, addr_unit)) 3135 3134 return -EINVAL; 3136 3135 3137 3136 addr_range.start = *start; 3138 3137 addr_range.end = *end; 3139 - return damon_set_regions(t, &addr_range, 1, min_region_sz); 3138 + return damon_set_regions(t, &addr_range, addr_unit, min_region_sz); 3140 3139 } 3141 3140 3142 3141 /*
+1
mm/damon/lru_sort.c
··· 345 345 err = damon_set_region_biggest_system_ram_default(param_target, 346 346 &monitor_region_start, 347 347 &monitor_region_end, 348 + param_ctx->addr_unit, 348 349 param_ctx->min_region_sz); 349 350 if (err) 350 351 goto out;
+1
mm/damon/reclaim.c
··· 251 251 err = damon_set_region_biggest_system_ram_default(param_target, 252 252 &monitor_region_start, 253 253 &monitor_region_end, 254 + param_ctx->addr_unit, 254 255 param_ctx->min_region_sz); 255 256 if (err) 256 257 goto out;