Skip to content

Commit 07da218

Browse files
sjp38akpm00
authored andcommitted
mm/damon: remove ->before_start of damon_callback
The function pointer field was added to be used as a place to do some initialization works just before DAMON starts working. However, nobody is using it now. Remove it. Link: https://lkml.kernel.org/r/20250306175908.66300-11-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 53058c7 commit 07da218

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

include/linux/damon.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -603,16 +603,14 @@ struct damon_operations {
603603
/**
604604
* struct damon_callback - Monitoring events notification callbacks.
605605
*
606-
* @before_start: Called before starting the monitoring.
607606
* @after_wmarks_check: Called after each schemes' watermarks check.
608607
* @after_sampling: Called after each sampling.
609608
* @after_aggregation: Called after each aggregation.
610609
* @before_damos_apply: Called before applying DAMOS action.
611610
* @before_terminate: Called before terminating the monitoring.
612611
*
613-
* The monitoring thread (&damon_ctx.kdamond) calls @before_start and
614-
* @before_terminate just before starting and finishing the monitoring,
615-
* respectively.
612+
* The monitoring thread (&damon_ctx.kdamond) calls @before_terminate just
613+
* before finishing the monitoring.
616614
*
617615
* The monitoring thread calls @after_wmarks_check after each DAMON-based
618616
* operation schemes' watermarks check. If users need to make changes to the
@@ -628,7 +626,6 @@ struct damon_operations {
628626
* If any callback returns non-zero, monitoring stops.
629627
*/
630628
struct damon_callback {
631-
int (*before_start)(struct damon_ctx *context);
632629
int (*after_wmarks_check)(struct damon_ctx *context);
633630
int (*after_sampling)(struct damon_ctx *context);
634631
int (*after_aggregation)(struct damon_ctx *context);

mm/damon/core.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2408,8 +2408,6 @@ static int kdamond_fn(void *data)
24082408

24092409
if (ctx->ops.init)
24102410
ctx->ops.init(ctx);
2411-
if (ctx->callback.before_start && ctx->callback.before_start(ctx))
2412-
goto done;
24132411
ctx->regions_score_histogram = kmalloc_array(DAMOS_MAX_SCORE + 1,
24142412
sizeof(*ctx->regions_score_histogram), GFP_KERNEL);
24152413
if (!ctx->regions_score_histogram)

0 commit comments

Comments
 (0)