linux-stable/mm/damon
SeongJae Park 9cad9a2e89 mm/damon/reclaim: fix quota stauts loss due to online tunings
commit 1b0ca4e4ff upstream.

Patch series "mm/damon: fix quota status loss due to online tunings".

DAMON_RECLAIM and DAMON_LRU_SORT is not preserving internal quota status
when applying new user parameters, and hence could cause temporal quota
accuracy degradation.  Fix it by preserving the status.


This patch (of 2):

For online parameters change, DAMON_RECLAIM creates new scheme based on
latest values of the parameters and replaces the old scheme with the new
one.  When creating it, the internal status of the quota of the old
scheme is not preserved.  As a result, charging of the quota starts from
zero after the online tuning.  The data that collected to estimate the
throughput of the scheme's action is also reset, and therefore the
estimation should start from the scratch again.  Because the throughput
estimation is being used to convert the time quota to the effective size
quota, this could result in temporal time quota inaccuracy.  It would be
recovered over time, though.  In short, the quota accuracy could be
temporarily degraded after online parameters update.

Fix the problem by checking the case and copying the internal fields for
the status.

Link: https://lkml.kernel.org/r/20240216194025.9207-1-sj@kernel.org
Link: https://lkml.kernel.org/r/20240216194025.9207-2-sj@kernel.org
Fixes: e035c280f6 ("mm/damon/reclaim: support online inputs update")
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>	[5.19+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-03-01 13:35:00 +01:00
..
Kconfig mm/damon/Kconfig: add DAMON debugfs interface deprecation notice 2023-02-13 15:54:32 -08:00
Makefile mm/damon/modules: deduplicate init steps for DAMON context setup 2022-11-30 15:01:26 -08:00
core-test.h mm/damon/core-test: add a unit test for __damos_filter_out() 2023-08-21 13:37:35 -07:00
core.c mm/damon/core: make damon_start() waits until kdamond_fn() starts 2024-01-01 12:42:23 +00:00
dbgfs-test.h mm/damon/dbgfs-test: fix is_target_id() change 2022-03-22 15:57:12 -07:00
dbgfs.c mm/damon/dbgfs: print DAMON debugfs interface deprecation message 2023-02-13 15:54:33 -08:00
lru_sort.c mm/damon/lru_sort: fix quota status loss due to online tunings 2024-03-01 13:35:00 +01:00
modules-common.c mm/damon/modules: deduplicate init steps for DAMON context setup 2022-11-30 15:01:26 -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-11-28 17:19:58 +00: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 damon: use pmdp_get instead of drectly dereferencing pmd 2023-08-21 13:37:30 -07:00
reclaim.c mm/damon/reclaim: fix quota stauts loss due to online tunings 2024-03-01 13:35:00 +01: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: implement a command for updating only schemes tried total bytes 2023-08-21 13:37:34 -07:00
sysfs-schemes.c mm/damon/sysfs-schemes: handle tried regions sysfs directory allocation failure 2023-11-28 17:19:58 +00:00
sysfs.c mm/damon/sysfs: eliminate potential uninitialized variable warning 2023-12-13 18:45:11 +01:00
vaddr-test.h mm/damon/vaddr-test: fix memory leak in damon_do_test_apply_three_regions() 2023-09-29 17:20:47 -07:00
vaddr.c mm: hugetlb: add huge page size param to set_huge_pte_at() 2023-09-29 17:20:47 -07:00