Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/damon: remove damon_operations->cleanup()

Patch series "mm/damon: cleanup kdamond, damon_call(), damos filter and
DAMON_MIN_REGION".

Do miscellaneous code cleanups for improving readability. First three
patches cleanup kdamond termination process, by removing unused operation
set cleanup callback (patch 1) and moving damon_ctx specific resource
cleanups on kdamond termination to synchronization-easy place (patches 2
and 3). Next two patches touch damon_call() infrastructure, by
refactoring kdamond_call() function to do less and simpler locking
operations (patch 4), and documenting when dealloc_on_free does work
(patch 5). Final three patches rename things for clear uses of those.
Those rename damos_filter_out() to be more explicit about the fact that it
is only for core-handled filters (patch 6), DAMON_MIN_REGION macro to be
more explicit it is not about number of regions but size of each region
(patch 7), and damon_ctx->min_sz_region to be different from
damos_access_patern->min_sz_region (patch 8), so that those are not
confusing and easy to grep.


This patch (of 8):

damon_operations->cleanup() was added for a case that an operation set
implementation requires additional cleanups. But no such implementation
exists at the moment. Remove it.

Link: https://lkml.kernel.org/r/20260117175256.82826-1-sj@kernel.org
Link: https://lkml.kernel.org/r/20260117175256.82826-2-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

SeongJae Park and committed by
Andrew Morton
50962b16 6f06f86a

-7
-3
include/linux/damon.h
··· 607 607 * @apply_scheme: Apply a DAMON-based operation scheme. 608 608 * @target_valid: Determine if the target is valid. 609 609 * @cleanup_target: Clean up each target before deallocation. 610 - * @cleanup: Clean up the context. 611 610 * 612 611 * DAMON can be extended for various address spaces and usages. For this, 613 612 * users should register the low level operations for their target address ··· 639 640 * @target_valid should check whether the target is still valid for the 640 641 * monitoring. 641 642 * @cleanup_target is called before the target will be deallocated. 642 - * @cleanup is called from @kdamond just before its termination. 643 643 */ 644 644 struct damon_operations { 645 645 enum damon_ops_id id; ··· 654 656 struct damos *scheme, unsigned long *sz_filter_passed); 655 657 bool (*target_valid)(struct damon_target *t); 656 658 void (*cleanup_target)(struct damon_target *t); 657 - void (*cleanup)(struct damon_ctx *context); 658 659 }; 659 660 660 661 /*
-2
mm/damon/core.c
··· 2859 2859 damon_destroy_region(r, t); 2860 2860 } 2861 2861 2862 - if (ctx->ops.cleanup) 2863 - ctx->ops.cleanup(ctx); 2864 2862 kfree(ctx->regions_score_histogram); 2865 2863 kdamond_call(ctx, true); 2866 2864
-1
mm/damon/paddr.c
··· 373 373 .prepare_access_checks = damon_pa_prepare_access_checks, 374 374 .check_accesses = damon_pa_check_accesses, 375 375 .target_valid = NULL, 376 - .cleanup = NULL, 377 376 .apply_scheme = damon_pa_apply_scheme, 378 377 .get_scheme_score = damon_pa_scheme_score, 379 378 };
-1
mm/damon/vaddr.c
··· 1014 1014 .check_accesses = damon_va_check_accesses, 1015 1015 .target_valid = damon_va_target_valid, 1016 1016 .cleanup_target = damon_va_cleanup_target, 1017 - .cleanup = NULL, 1018 1017 .apply_scheme = damon_va_apply_scheme, 1019 1018 .get_scheme_score = damon_va_scheme_score, 1020 1019 };