linux-stable/mm/damon
SeongJae Park 7ebeee513f 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:26:39 +01:00
..
Kconfig mm/damon/Kconfig: notify debugfs deprecation plan 2022-10-03 14:03:06 -07:00
Makefile mm/damon: introduce DAMON-based LRU-lists Sorting 2022-07-03 18:08:43 -07:00
core-test.h mm/damon/core-test: test damon_set_regions 2022-10-03 14:03:06 -07:00
core.c mm/damon/core: make damon_start() waits until kdamond_fn() starts 2024-01-01 12:39:08 +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: check if rm_contexts input is for a real context 2022-11-08 15:57:25 -08:00
lru_sort.c mm/damon/lru_sort: fix quota status loss due to online tunings 2024-03-01 13:26:32 +01:00
modules-common.h mm/damon/modules-common: implement damos time quota params generator 2022-10-03 14:03:13 -07:00
ops-common.c mm/damon/ops-common: avoid divide-by-zero during region hotness calculation 2023-11-28 17:07:09 +00:00
ops-common.h mm/damon/ops-common: atomically test and clear young on ptes and pmds 2023-07-19 16:22:11 +02:00
paddr.c mm/damon/ops-common: atomically test and clear young on ptes and pmds 2023-07-19 16:22:11 +02:00
reclaim.c mm/damon/reclaim: fix quota stauts loss due to online tunings 2024-03-01 13:26:39 +01:00
sysfs.c mm/damon/sysfs: eliminate potential uninitialized variable warning 2023-12-13 18:39:12 +01:00
vaddr-test.h mm/damon/vaddr-test: fix memory leak in damon_do_test_apply_three_regions() 2023-10-06 14:57:03 +02:00
vaddr.c mm/damon/ops-common: atomically test and clear young on ptes and pmds 2023-07-19 16:22:11 +02:00