summaryrefslogtreecommitdiffstats
path: root/mm/damon/ops-common.c
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2022-09-13 19:44:32 +0200
committerAndrew Morton <akpm@linux-foundation.org>2022-10-03 23:03:10 +0200
commitcbeaa77b044938cfe91818821ece6b0b1511e967 (patch)
treee29224edf924d78632e8af0dc2b081e28825e862 /mm/damon/ops-common.c
parentmm/damon/core: factor out 'damos_quota' private fileds initialization (diff)
downloadlinux-cbeaa77b044938cfe91818821ece6b0b1511e967.tar.xz
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/ops-common.c')
-rw-r--r--mm/damon/ops-common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/damon/ops-common.c b/mm/damon/ops-common.c
index f599838b5f64..9310df72e1c5 100644
--- a/mm/damon/ops-common.c
+++ b/mm/damon/ops-common.c
@@ -99,10 +99,10 @@ int damon_hot_score(struct damon_ctx *c, struct damon_region *r,
unsigned int age_weight = s->quota.weight_age;
int hotness;
- max_nr_accesses = c->aggr_interval / c->sample_interval;
+ max_nr_accesses = c->attrs.aggr_interval / c->attrs.sample_interval;
freq_subscore = r->nr_accesses * DAMON_MAX_SUBSCORE / max_nr_accesses;
- age_in_sec = (unsigned long)r->age * c->aggr_interval / 1000000;
+ age_in_sec = (unsigned long)r->age * c->attrs.aggr_interval / 1000000;
for (age_in_log = 0; age_in_log < DAMON_MAX_AGE_IN_LOG && age_in_sec;
age_in_log++, age_in_sec >>= 1)
;