Skip to content

Commit ae666a6

Browse files
sjp38torvalds
authored andcommitted
mm/damon/dbgfs: support watermarks
This updates DAMON debugfs interface to support the watermarks based schemes activation. For this, now 'schemes' file receives five more values. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: SeongJae Park <[email protected]> Cc: Amit Shah <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: David Hildenbrand <[email protected]> Cc: David Rientjes <[email protected]> Cc: David Woodhouse <[email protected]> Cc: Greg Thelen <[email protected]> Cc: Jonathan Cameron <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Leonard Foerster <[email protected]> Cc: Marco Elver <[email protected]> Cc: Markus Boehme <[email protected]> Cc: Shakeel Butt <[email protected]> Cc: Shuah Khan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent ee801b7 commit ae666a6

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

mm/damon/dbgfs.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static ssize_t sprint_schemes(struct damon_ctx *c, char *buf, ssize_t len)
105105

106106
damon_for_each_scheme(s, c) {
107107
rc = scnprintf(&buf[written], len - written,
108-
"%lu %lu %u %u %u %u %d %lu %lu %lu %u %u %u %lu %lu\n",
108+
"%lu %lu %u %u %u %u %d %lu %lu %lu %u %u %u %d %lu %lu %lu %lu %lu %lu\n",
109109
s->min_sz_region, s->max_sz_region,
110110
s->min_nr_accesses, s->max_nr_accesses,
111111
s->min_age_region, s->max_age_region,
@@ -115,6 +115,8 @@ static ssize_t sprint_schemes(struct damon_ctx *c, char *buf, ssize_t len)
115115
s->quota.weight_sz,
116116
s->quota.weight_nr_accesses,
117117
s->quota.weight_age,
118+
s->wmarks.metric, s->wmarks.interval,
119+
s->wmarks.high, s->wmarks.mid, s->wmarks.low,
118120
s->stat_count, s->stat_sz);
119121
if (!rc)
120122
return -ENOMEM;
@@ -195,18 +197,18 @@ static struct damos **str_to_schemes(const char *str, ssize_t len,
195197
*nr_schemes = 0;
196198
while (pos < len && *nr_schemes < max_nr_schemes) {
197199
struct damos_quota quota = {};
198-
struct damos_watermarks wmarks = {
199-
.metric = DAMOS_WMARK_NONE,
200-
};
200+
struct damos_watermarks wmarks;
201201

202202
ret = sscanf(&str[pos],
203-
"%lu %lu %u %u %u %u %u %lu %lu %lu %u %u %u%n",
203+
"%lu %lu %u %u %u %u %u %lu %lu %lu %u %u %u %u %lu %lu %lu %lu%n",
204204
&min_sz, &max_sz, &min_nr_a, &max_nr_a,
205205
&min_age, &max_age, &action, &quota.ms,
206206
&quota.sz, &quota.reset_interval,
207207
&quota.weight_sz, &quota.weight_nr_accesses,
208-
&quota.weight_age, &parsed);
209-
if (ret != 13)
208+
&quota.weight_age, &wmarks.metric,
209+
&wmarks.interval, &wmarks.high, &wmarks.mid,
210+
&wmarks.low, &parsed);
211+
if (ret != 18)
210212
break;
211213
if (!damos_action_valid(action)) {
212214
pr_err("wrong action %d\n", action);

0 commit comments

Comments
 (0)