summaryrefslogtreecommitdiffstats
path: root/mm/damon/vaddr.c
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2022-09-13 17:44:32 +0000
committerAndrew Morton <akpm@linux-foundation.org>2022-10-03 14:03:10 -0700
commitcbeaa77b044938cfe91818821ece6b0b1511e967 (patch)
treee29224edf924d78632e8af0dc2b081e28825e862 /mm/damon/vaddr.c
parent70e0c1d1bf945328915f52f7132b2d6ee8f25d46 (diff)
downloadlinux-cbeaa77b044938cfe91818821ece6b0b1511e967.tar.gz
linux-cbeaa77b044938cfe91818821ece6b0b1511e967.tar.bz2
linux-cbeaa77b044938cfe91818821ece6b0b1511e967.zip
mm/damon/core: use a dedicated struct for monitoring attributes
DAMON monitoring attributes are directly defined as fields of 'struct damon_ctx'. This makes 'struct damon_ctx' a little long and complicated. This commit defines and uses a struct, 'struct damon_attrs', which is dedicated for only the monitoring attributes to make the purpose of the five values clearer and simplify 'struct damon_ctx'. Link: https://lkml.kernel.org/r/20220913174449.50645-6-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/vaddr.c')
-rw-r--r--mm/damon/vaddr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
index c2c08c1b316b..0eae47bd9ccb 100644
--- a/mm/damon/vaddr.c
+++ b/mm/damon/vaddr.c
@@ -251,8 +251,8 @@ static void __damon_va_init_regions(struct damon_ctx *ctx,
for (i = 0; i < 3; i++)
sz += regions[i].end - regions[i].start;
- if (ctx->min_nr_regions)
- sz /= ctx->min_nr_regions;
+ if (ctx->attrs.min_nr_regions)
+ sz /= ctx->attrs.min_nr_regions;
if (sz < DAMON_MIN_REGION)
sz = DAMON_MIN_REGION;