[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210531133816.12689-12-sj38.park@gmail.com>
Date: Mon, 31 May 2021 13:38:14 +0000
From: sj38.park@...il.com
To: akpm@...ux-foundation.org
Cc: SeongJae Park <sjpark@...zon.de>, Jonathan.Cameron@...wei.com,
acme@...nel.org, alexander.shishkin@...ux.intel.com,
amit@...nel.org, benh@...nel.crashing.org,
brendanhiggins@...gle.com, corbet@....net, david@...hat.com,
dwmw@...zon.com, elver@...gle.com, fan.du@...el.com,
foersleo@...zon.de, greg@...ah.com, gthelen@...gle.com,
guoju.fgj@...baba-inc.com, mgorman@...e.de, minchan@...nel.org,
mingo@...hat.com, namhyung@...nel.org, peterz@...radead.org,
riel@...riel.com, rientjes@...gle.com, rostedt@...dmis.org,
rppt@...nel.org, shakeelb@...gle.com, shuah@...nel.org,
sj38.park@...il.com, snu@...le79.org, vbabka@...e.cz,
vdavydov.dev@...il.com, zgf574564920@...il.com,
linux-damon@...zon.com, linux-mm@...ck.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [RFC PATCH 11/13] mm/damon/dbgfs: Support watermarks
From: SeongJae Park <sjpark@...zon.de>
This commit updates DAMON debugfs interface to support the watermarks
based schemes activation. For this, now 'schemes' file receives five
more values.
Signed-off-by: SeongJae Park <sjpark@...zon.de>
---
mm/damon/dbgfs.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c
index 1680fb1be8e1..768ef3eb9550 100644
--- a/mm/damon/dbgfs.c
+++ b/mm/damon/dbgfs.c
@@ -227,7 +227,7 @@ static ssize_t sprint_schemes(struct damon_ctx *c, char *buf, ssize_t len)
damon_for_each_scheme(s, c) {
rc = scnprintf(&buf[written], len - written,
- "%lu %lu %u %u %u %u %d %lu %lu %u %u %u %lu %lu\n",
+ "%lu %lu %u %u %u %u %d %lu %lu %u %u %u %d %lu %lu %lu %lu %lu %lu\n",
s->min_sz_region, s->max_sz_region,
s->min_nr_accesses, s->max_nr_accesses,
s->min_age_region, s->max_age_region,
@@ -235,6 +235,8 @@ static ssize_t sprint_schemes(struct damon_ctx *c, char *buf, ssize_t len)
s->limit.weight_sz,
s->limit.weight_nr_accesses,
s->limit.weight_age,
+ s->wmarks.metric, s->wmarks.interval,
+ s->wmarks.high, s->wmarks.mid, s->wmarks.low,
s->stat_count, s->stat_sz);
if (!rc)
return -ENOMEM;
@@ -315,18 +317,18 @@ static struct damos **str_to_schemes(const char *str, ssize_t len,
*nr_schemes = 0;
while (pos < len && *nr_schemes < max_nr_schemes) {
struct damos_speed_limit limit = {};
- struct damos_watermarks wmarks = {
- .metric = DAMOS_WMARK_NONE,
- };
+ struct damos_watermarks wmarks;
ret = sscanf(&str[pos],
- "%lu %lu %u %u %u %u %u %lu %lu %u %u %u%n",
+ "%lu %lu %u %u %u %u %u %lu %lu %u %u %u %u %lu %lu %lu %lu%n",
&min_sz, &max_sz, &min_nr_a, &max_nr_a,
&min_age, &max_age, &action, &limit.sz,
&limit.ms, &limit.weight_sz,
&limit.weight_nr_accesses, &limit.weight_age,
+ &wmarks.metric, &wmarks.interval,
+ &wmarks.high, &wmarks.mid, &wmarks.low,
&parsed);
- if (ret != 12)
+ if (ret != 17)
break;
if (!damos_action_valid(action)) {
pr_err("wrong action %d\n", action);
--
2.17.1
Powered by blists - more mailing lists