mm/damon/sysfs-schemes: commit damos quota goals user input to DAMOS
authorSeongJae Park <sj@kernel.org>
Thu, 30 Nov 2023 02:36:46 +0000 (02:36 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 12 Dec 2023 18:57:03 +0000 (10:57 -0800)
commit8b549a4fd3c5fd721e268564596095398b0469bc
treed4191189775ea12526c216bb93431babb3de8713
parent7f262da0a30df32a960f90ab6c11b08a7233ea34
mm/damon/sysfs-schemes: commit damos quota goals user input to DAMOS

Make DAMON sysfs interface to read the user inputs for DAMOS quota goals
and pass those to DAMOS, so that the users can use the quota auto-tuning
feature.  It uses the DAMON sysfs interface's user input commit mechanism,
which applies all user inputs for initial starting of DAMON and online
input updates, which can be done by writing 'on' and 'commit' to the
kdamond's 'state' file, respectively.  In other words, the user should
periodically write appropriate value to 'current_value' files and 'commit'
command to the 'state' file.  'target_value' files could also be similarly
updated at any time.

Note that the interface is supporting multiple goals while the core logic
supports only one goal.  DAMON sysfs interface passes only best feedback
among the given inputs, to avoid making DAMOS too aggressive.

Link: https://lkml.kernel.org/r/20231130023652.50284-4-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Brendan Higgins <brendanhiggins@google.com>
Cc: David Gow <davidgow@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/sysfs-schemes.c