• SeongJae Park's avatar
    mm/damon/lru_sort: fix quota status loss due to online tunings · 13d0599a
    SeongJae Park authored
    For online parameters change, DAMON_LRU_SORT creates new schemes based on
    latest values of the parameters and replaces the old schemes with the new
    one.  When creating it, the internal status of the quotas of the old
    schemes 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-3-sj@kernel.org
    Fixes: 40e983cc ("mm/damon: introduce DAMON-based LRU-lists Sorting")
    Signed-off-by: default avatarSeongJae Park <sj@kernel.org>
    Cc: <stable@vger.kernel.org>	[6.0+]
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    13d0599a
lru_sort.c 9.47 KB