linux-IllusionX/mm/damon
SeongJae Park 310d6c15e9 mm/damon/core: merge regions aggressively when max_nr_regions is unmet
DAMON keeps the number of regions under max_nr_regions by skipping regions
split operations when doing so can make the number higher than the limit. 
It works well for preventing violation of the limit.  But, if somehow the
violation happens, it cannot recovery well depending on the situation.  In
detail, if the real number of regions having different access pattern is
higher than the limit, the mechanism cannot reduce the number below the
limit.  In such a case, the system could suffer from high monitoring
overhead of DAMON.

The violation can actually happen.  For an example, the user could reduce
max_nr_regions while DAMON is running, to be lower than the current number
of regions.  Fix the problem by repeating the merge operations with
increasing aggressiveness in kdamond_merge_regions() for the case, until
the limit is met.

[sj@kernel.org: increase regions merge aggressiveness while respecting min_nr_regions]
  Link: https://lkml.kernel.org/r/20240626164753.46270-1-sj@kernel.org
[sj@kernel.org: ensure max threshold attempt for max_nr_regions violation]
  Link: https://lkml.kernel.org/r/20240627163153.75969-1-sj@kernel.org
Link: https://lkml.kernel.org/r/20240624175814.89611-1-sj@kernel.org
Fixes: b9a6ac4e4e ("mm/damon: adaptively adjust regions")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>	[5.15+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-07-03 22:40:36 -07:00
..
core-test.h mm/damon/core-test: test max_nr_accesses overflow caused divide-by-zero 2023-12-20 14:48:13 -08:00
core.c mm/damon/core: merge regions aggressively when max_nr_regions is unmet 2024-07-03 22:40:36 -07:00
dbgfs-test.h mm/damon: update email of SeongJae 2023-12-20 14:48:13 -08:00
dbgfs.c mm/damon/dbgfs: rename monitor_on file to monitor_on_DEPRECATED 2024-02-22 10:24:46 -08:00
Kconfig mm/damon: rename CONFIG_DAMON_DBGFS to DAMON_DBGFS_DEPRECATED 2024-02-22 10:24:45 -08:00
lru_sort.c mm/damon/lru_sort: fix quota status loss due to online tunings 2024-02-20 14:20:50 -08:00
Makefile mm/damon/modules: deduplicate init steps for DAMON context setup 2022-11-30 15:01:26 -08:00
modules-common.c mm/damon: update email of SeongJae 2023-12-20 14:48:13 -08:00
modules-common.h mm/damon/modules: deduplicate init steps for DAMON context setup 2022-11-30 15:01:26 -08:00
ops-common.c mm/damon/ops-common: avoid divide-by-zero during region hotness calculation 2023-10-25 16:47:15 -07:00
ops-common.h mm/damon/ops-common: atomically test and clear young on ptes and pmds 2023-06-09 16:25:55 -07:00
paddr.c mm/vmscan: remove ignore_references argument of reclaim_pages() 2024-05-07 10:37:02 -07:00
reclaim.c mm/damon/reclaim: implement memory PSI-driven quota self-tuning 2024-02-23 17:48:30 -08:00
sysfs-common.c mm/damon/sysfs: make kobj_type structures constant 2023-02-09 16:51:45 -08:00
sysfs-common.h mm/damon/sysfs: use only quota->goals 2024-02-23 17:48:27 -08:00
sysfs-schemes.c mm/damon: add DAMOS filter type YOUNG 2024-05-05 17:53:55 -07:00
sysfs-test.h mm/damon/sysfs-test: add a unit test for damon_sysfs_set_targets() 2023-10-25 16:47:15 -07:00
sysfs.c mm/damon/sysfs: use only quota->goals 2024-02-23 17:48:27 -08:00
vaddr-test.h mm/damon: update email of SeongJae 2023-12-20 14:48:13 -08:00
vaddr.c mm/damon/vaddr: change asm-generic/mman-common.h to linux/mman.h 2023-12-29 11:58:57 -08:00