From: Asier Gutierrez damon_target is not used by get_scheme_score operations, nor with virtual neither with physical addresses. Signed-off-by: Asier Gutierrez --- include/linux/damon.h | 3 +-- mm/damon/core.c | 10 +++++----- mm/damon/paddr.c | 3 +-- mm/damon/vaddr.c | 3 +-- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/include/linux/damon.h b/include/linux/damon.h index 3813373a9200..34b68f5af425 100644 --- a/include/linux/damon.h +++ b/include/linux/damon.h @@ -639,8 +639,7 @@ struct damon_operations { void (*prepare_access_checks)(struct damon_ctx *context); unsigned int (*check_accesses)(struct damon_ctx *context); int (*get_scheme_score)(struct damon_ctx *context, - struct damon_target *t, struct damon_region *r, - struct damos *scheme); + struct damon_region *r, struct damos *scheme); unsigned long (*apply_scheme)(struct damon_ctx *context, struct damon_target *t, struct damon_region *r, struct damos *scheme, unsigned long *sz_filter_passed); diff --git a/mm/damon/core.c b/mm/damon/core.c index 84f80a20f233..cc4cc953f3a4 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -1651,15 +1651,15 @@ static bool __damos_valid_target(struct damon_region *r, struct damos *s) r->age <= s->pattern.max_age_region; } -static bool damos_valid_target(struct damon_ctx *c, struct damon_target *t, - struct damon_region *r, struct damos *s) +static bool damos_valid_target(struct damon_ctx *c, struct damon_region *r, + struct damos *s) { bool ret = __damos_valid_target(r, s); if (!ret || !s->quota.esz || !c->ops.get_scheme_score) return ret; - return c->ops.get_scheme_score(c, t, r, s) >= s->quota.min_score; + return c->ops.get_scheme_score(c, r, s) >= s->quota.min_score; } /* @@ -1978,7 +1978,7 @@ static void damon_do_apply_schemes(struct damon_ctx *c, if (damos_skip_charged_region(t, &r, s, c->min_sz_region)) continue; - if (!damos_valid_target(c, t, r, s)) + if (!damos_valid_target(c, r, s)) continue; damos_apply_scheme(c, t, r, s); @@ -2256,7 +2256,7 @@ static void damos_adjust_quota(struct damon_ctx *c, struct damos *s) damon_for_each_region(r, t) { if (!__damos_valid_target(r, s)) continue; - score = c->ops.get_scheme_score(c, t, r, s); + score = c->ops.get_scheme_score(c, r, s); c->regions_score_histogram[score] += damon_sz_region(r); if (score > max_score) diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c index 07a8aead439e..7b4b1e27beb7 100644 --- a/mm/damon/paddr.c +++ b/mm/damon/paddr.c @@ -345,8 +345,7 @@ static unsigned long damon_pa_apply_scheme(struct damon_ctx *ctx, } static int damon_pa_scheme_score(struct damon_ctx *context, - struct damon_target *t, struct damon_region *r, - struct damos *scheme) + struct damon_region *r, struct damos *scheme) { switch (scheme->action) { case DAMOS_PAGEOUT: diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c index 23ed738a0bd6..757b9e18847a 100644 --- a/mm/damon/vaddr.c +++ b/mm/damon/vaddr.c @@ -986,8 +986,7 @@ static unsigned long damon_va_apply_scheme(struct damon_ctx *ctx, } static int damon_va_scheme_score(struct damon_ctx *context, - struct damon_target *t, struct damon_region *r, - struct damos *scheme) + struct damon_region *r, struct damos *scheme) { switch (scheme->action) { -- 2.43.0