summaryrefslogtreecommitdiffstats
path: root/mm/damon/sysfs-schemes.c
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2023-11-30 02:36:47 +0000
committerAndrew Morton <akpm@linux-foundation.org>2023-12-12 10:57:03 -0800
commitd91beaa505a0789c78adcf3ab021f5ed79794697 (patch)
tree257a39f8aff57bee9466a830db5cd4a2e249a2f2 /mm/damon/sysfs-schemes.c
parent8b549a4fd3c5fd721e268564596095398b0469bc (diff)
downloadlinux-d91beaa505a0789c78adcf3ab021f5ed79794697.tar.gz
linux-d91beaa505a0789c78adcf3ab021f5ed79794697.tar.bz2
linux-d91beaa505a0789c78adcf3ab021f5ed79794697.zip
mm/damon/sysfs-schemes: implement a command for scheme quota goals only commit
To update DAMOS quota goals, users need to enter 'commit' command to the 'state' file of the kdamond, which applies not only the goals but entire inputs. It is inefficient. Implement yet another 'state' file input command for reading and committing only the scheme quota goals, namely 'commit_schemes_quota_goals'. Link: https://lkml.kernel.org/r/20231130023652.50284-5-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>
Diffstat (limited to 'mm/damon/sysfs-schemes.c')
-rw-r--r--mm/damon/sysfs-schemes.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c
index a7917534ca19..8dbaac6e5c2d 100644
--- a/mm/damon/sysfs-schemes.c
+++ b/mm/damon/sysfs-schemes.c
@@ -1896,6 +1896,22 @@ static void damos_sysfs_set_quota_score(
}
}
+void damos_sysfs_set_quota_scores(struct damon_sysfs_schemes *sysfs_schemes,
+ struct damon_ctx *ctx)
+{
+ struct damos *scheme;
+ int i = 0;
+
+ damon_for_each_scheme(scheme, ctx) {
+ struct damon_sysfs_scheme *sysfs_scheme;
+
+ sysfs_scheme = sysfs_schemes->schemes_arr[i];
+ damos_sysfs_set_quota_score(sysfs_scheme->quotas->goals,
+ &scheme->quota);
+ i++;
+ }
+}
+
static struct damos *damon_sysfs_mk_scheme(
struct damon_sysfs_scheme *sysfs_scheme)
{