mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
mm/damon/core: remove damon_set_region_biggest_system_ram_default()
Now nobody is using damon_set_region_biggest_system_ram_default(). Remove it. Link: https://lore.kernel.org/20260429041232.90257-5-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Cc: David Hildenbrand <david@kernel.org> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Liam R. Howlett <liam@infradead.org> Cc: Lorenzo Stoakes <ljs@kernel.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
e17741ad08
commit
3a870b4377
|
|
@ -1015,11 +1015,6 @@ int damon_set_region_system_rams_default(struct damon_target *t,
|
|||
unsigned long addr_unit,
|
||||
unsigned long min_region_sz);
|
||||
|
||||
int damon_set_region_biggest_system_ram_default(struct damon_target *t,
|
||||
unsigned long *start, unsigned long *end,
|
||||
unsigned long addr_unit,
|
||||
unsigned long min_region_sz);
|
||||
|
||||
#endif /* CONFIG_DAMON */
|
||||
|
||||
#endif /* _DAMON_H */
|
||||
|
|
|
|||
|
|
@ -3408,70 +3408,6 @@ int damon_set_region_system_rams_default(struct damon_target *t,
|
|||
return damon_set_regions(t, &addr_range, 1, min_region_sz);
|
||||
}
|
||||
|
||||
static int walk_system_ram(struct resource *res, void *arg)
|
||||
{
|
||||
struct resource *a = arg;
|
||||
|
||||
if (resource_size(a) < resource_size(res)) {
|
||||
a->start = res->start;
|
||||
a->end = res->end;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find biggest 'System RAM' resource and store its start and end address in
|
||||
* @start and @end, respectively. If no System RAM is found, returns false.
|
||||
*/
|
||||
static bool damon_find_biggest_system_ram(unsigned long *start,
|
||||
unsigned long *end, unsigned long addr_unit)
|
||||
|
||||
{
|
||||
struct resource res = {};
|
||||
|
||||
walk_system_ram_res(0, -1, &res, walk_system_ram);
|
||||
*start = damon_res_to_core_addr(res.start, addr_unit);
|
||||
*end = damon_res_to_core_addr(res.end + 1, addr_unit);
|
||||
if (*end <= *start)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* damon_set_region_biggest_system_ram_default() - Set the region of the given
|
||||
* monitoring target as requested, or biggest 'System RAM'.
|
||||
* @t: The monitoring target to set the region.
|
||||
* @start: The pointer to the start address of the region.
|
||||
* @end: The pointer to the end address of the region.
|
||||
* @addr_unit: The address unit for the damon_ctx of @t.
|
||||
* @min_region_sz: Minimum region size.
|
||||
*
|
||||
* This function sets the region of @t as requested by @start and @end. If the
|
||||
* values of @start and @end are zero, however, this function finds the biggest
|
||||
* 'System RAM' resource and sets the region to cover the resource. In the
|
||||
* latter case, this function saves the start and end addresses of the resource
|
||||
* in @start and @end, respectively.
|
||||
*
|
||||
* Return: 0 on success, negative error code otherwise.
|
||||
*/
|
||||
int damon_set_region_biggest_system_ram_default(struct damon_target *t,
|
||||
unsigned long *start, unsigned long *end,
|
||||
unsigned long addr_unit, unsigned long min_region_sz)
|
||||
{
|
||||
struct damon_addr_range addr_range;
|
||||
|
||||
if (*start > *end)
|
||||
return -EINVAL;
|
||||
|
||||
if (!*start && !*end &&
|
||||
!damon_find_biggest_system_ram(start, end, addr_unit))
|
||||
return -EINVAL;
|
||||
|
||||
addr_range.start = *start;
|
||||
addr_range.end = *end;
|
||||
return damon_set_regions(t, &addr_range, 1, min_region_sz);
|
||||
}
|
||||
|
||||
/*
|
||||
* damon_moving_sum() - Calculate an inferred moving sum value.
|
||||
* @mvsum: Inferred sum of the last @len_window values.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user