summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2021-11-05 13:47:27 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-11-06 13:30:45 -0700
commitd7d0ec85e983945079364db3c3d2d80cc795a48c (patch)
tree2ce8e4b54a9333a9b65d706b8b641ce8c732fda5 /mm
parent1cd2430300594a230dba9178ac9e286d868d9da2 (diff)
mm/damon/dbgfs: support quotas of schemes
This makes the debugfs interface of DAMON support the scheme quotas by chaning the format of the input for the schemes file. Link: https://lkml.kernel.org/r/20211019150731.16699-6-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Cc: Amit Shah <amit@kernel.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: David Hildenbrand <david@redhat.com> Cc: David Rientjes <rientjes@google.com> Cc: David Woodhouse <dwmw@amazon.com> Cc: Greg Thelen <gthelen@google.com> Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: Leonard Foerster <foersleo@amazon.de> Cc: Marco Elver <elver@google.com> Cc: Markus Boehme <markubo@amazon.de> Cc: Shakeel Butt <shakeelb@google.com> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/damon/dbgfs.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c
index a04bd50cc4c4..097e6745ba75 100644
--- a/mm/damon/dbgfs.c
+++ b/mm/damon/dbgfs.c
@@ -105,11 +105,14 @@ 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\n",
+ "%lu %lu %u %u %u %u %d %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,
- s->action, s->stat_count, s->stat_sz);
+ s->action,
+ s->quota.ms, s->quota.sz,
+ s->quota.reset_interval,
+ s->stat_count, s->stat_sz);
if (!rc)
return -ENOMEM;
@@ -190,10 +193,11 @@ static struct damos **str_to_schemes(const char *str, ssize_t len,
while (pos < len && *nr_schemes < max_nr_schemes) {
struct damos_quota quota = {};
- ret = sscanf(&str[pos], "%lu %lu %u %u %u %u %u%n",
+ ret = sscanf(&str[pos], "%lu %lu %u %u %u %u %u %lu %lu %lu%n",
&min_sz, &max_sz, &min_nr_a, &max_nr_a,
- &min_age, &max_age, &action, &parsed);
- if (ret != 7)
+ &min_age, &max_age, &action, &quota.ms,
+ &quota.sz, &quota.reset_interval, &parsed);
+ if (ret != 10)
break;
if (!damos_action_valid(action)) {
pr_err("wrong action %d\n", action);