Skip to content

Commit 8510405

Browse files
sjp38torvalds
authored andcommitted
mm/damon/paddr,vaddr: remove damon_{p,v}a_{target_valid,set_operations}()
Because DAMON debugfs interface and DAMON-based proactive reclaim are now using monitoring operations via registration mechanism, damon_{p,v}a_{target_valid,set_operations}() functions have no user. This commit clean them up. Link: https://lkml.kernel.org/r/20220215184603.1479-9-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Cc: David Rientjes <rientjes@google.com> Cc: Xin Hao <xhao@linux.alibaba.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 999b946 commit 8510405

3 files changed

Lines changed: 2 additions & 43 deletions

File tree

include/linux/damon.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -513,14 +513,4 @@ int damon_stop(struct damon_ctx **ctxs, int nr_ctxs);
513513

514514
#endif /* CONFIG_DAMON */
515515

516-
#ifdef CONFIG_DAMON_VADDR
517-
bool damon_va_target_valid(void *t);
518-
void damon_va_set_operations(struct damon_ctx *ctx);
519-
#endif /* CONFIG_DAMON_VADDR */
520-
521-
#ifdef CONFIG_DAMON_PADDR
522-
bool damon_pa_target_valid(void *t);
523-
void damon_pa_set_operations(struct damon_ctx *ctx);
524-
#endif /* CONFIG_DAMON_PADDR */
525-
526516
#endif /* _DAMON_H */

mm/damon/paddr.c

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,6 @@ static unsigned int damon_pa_check_accesses(struct damon_ctx *ctx)
208208
return max_nr_accesses;
209209
}
210210

211-
bool damon_pa_target_valid(void *t)
212-
{
213-
return true;
214-
}
215-
216211
static unsigned long damon_pa_apply_scheme(struct damon_ctx *ctx,
217212
struct damon_target *t, struct damon_region *r,
218213
struct damos *scheme)
@@ -261,19 +256,6 @@ static int damon_pa_scheme_score(struct damon_ctx *context,
261256
return DAMOS_MAX_SCORE;
262257
}
263258

264-
void damon_pa_set_operations(struct damon_ctx *ctx)
265-
{
266-
ctx->ops.init = NULL;
267-
ctx->ops.update = NULL;
268-
ctx->ops.prepare_access_checks = damon_pa_prepare_access_checks;
269-
ctx->ops.check_accesses = damon_pa_check_accesses;
270-
ctx->ops.reset_aggregated = NULL;
271-
ctx->ops.target_valid = damon_pa_target_valid;
272-
ctx->ops.cleanup = NULL;
273-
ctx->ops.apply_scheme = damon_pa_apply_scheme;
274-
ctx->ops.get_scheme_score = damon_pa_scheme_score;
275-
}
276-
277259
static int __init damon_pa_initcall(void)
278260
{
279261
struct damon_operations ops = {
@@ -283,7 +265,7 @@ static int __init damon_pa_initcall(void)
283265
.prepare_access_checks = damon_pa_prepare_access_checks,
284266
.check_accesses = damon_pa_check_accesses,
285267
.reset_aggregated = NULL,
286-
.target_valid = damon_pa_target_valid,
268+
.target_valid = NULL,
287269
.cleanup = NULL,
288270
.apply_scheme = damon_pa_apply_scheme,
289271
.get_scheme_score = damon_pa_scheme_score,

mm/damon/vaddr.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ static unsigned int damon_va_check_accesses(struct damon_ctx *ctx)
653653
* Functions for the target validity check and cleanup
654654
*/
655655

656-
bool damon_va_target_valid(void *target)
656+
static bool damon_va_target_valid(void *target)
657657
{
658658
struct damon_target *t = target;
659659
struct task_struct *task;
@@ -739,19 +739,6 @@ static int damon_va_scheme_score(struct damon_ctx *context,
739739
return DAMOS_MAX_SCORE;
740740
}
741741

742-
void damon_va_set_operations(struct damon_ctx *ctx)
743-
{
744-
ctx->ops.init = damon_va_init;
745-
ctx->ops.update = damon_va_update;
746-
ctx->ops.prepare_access_checks = damon_va_prepare_access_checks;
747-
ctx->ops.check_accesses = damon_va_check_accesses;
748-
ctx->ops.reset_aggregated = NULL;
749-
ctx->ops.target_valid = damon_va_target_valid;
750-
ctx->ops.cleanup = NULL;
751-
ctx->ops.apply_scheme = damon_va_apply_scheme;
752-
ctx->ops.get_scheme_score = damon_va_scheme_score;
753-
}
754-
755742
static int __init damon_va_initcall(void)
756743
{
757744
struct damon_operations ops = {

0 commit comments

Comments
 (0)