diff options
author | SeongJae Park <sj@kernel.org> | 2024-02-19 11:44:23 -0800 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2024-02-23 17:48:28 -0800 |
commit | bcce9bc16f56fbc254857fcb31674ab868b824d7 (patch) | |
tree | 121d181c945e37aa8ff3465e37f1afe3aa4efbe7 /mm/damon/sysfs-schemes.c | |
parent | 06ba5b309ed870cf1a0fedc611d0e7fbb6425a2d (diff) | |
download | linux-bcce9bc16f56fbc254857fcb31674ab868b824d7.tar.gz linux-bcce9bc16f56fbc254857fcb31674ab868b824d7.tar.bz2 linux-bcce9bc16f56fbc254857fcb31674ab868b824d7.zip |
mm/damon/core: support multiple metrics for quota goal
DAMOS quota auto-tuning asks users to assess the current tuned quota and
provide the feedback in a manual and repeated way. It allows users
generate the feedback from a source that the kernel cannot access, and
writing a script or a function for doing the manual and repeated feeding
is not a big deal. However, additional works are additional works, and it
could be more efficient if DAMOS could do the fetch itself, especially in
case of DAMON sysfs interface use case, since it can avoid the context
switches between the user-space and the kernel-space, though the overhead
would be only trivial in most cases. Also in many cases, feedbacks could
be made from kernel-accessible sources, such as PSI, CPU usage, etc. Make
the quota goal to support multiple types of metrics including such ones.
Link: https://lkml.kernel.org/r/20240219194431.159606-13-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/damon/sysfs-schemes.c')
-rw-r--r-- | mm/damon/sysfs-schemes.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c index 50218a7bfa0a..7a8a39f2679b 100644 --- a/mm/damon/sysfs-schemes.c +++ b/mm/damon/sysfs-schemes.c @@ -1899,10 +1899,11 @@ static int damos_sysfs_set_quota_score( if (!sysfs_goal->target_value) continue; - goal = damos_new_quota_goal(sysfs_goal->target_value, - sysfs_goal->current_value); + goal = damos_new_quota_goal(DAMOS_QUOTA_USER_INPUT, + sysfs_goal->target_value); if (!goal) return -ENOMEM; + goal->current_value = sysfs_goal->current_value; damos_add_quota_goal(quota, goal); } return 0; |