Skip to content

Commit cedee98

Browse files
sjp38akpm00
authored andcommitted
mm/damon: remove damon_callback->after_sampling
The callback was used by DAMON sysfs interface for reading DAMON internal data. But it is no more being used, and damon_call() can do similar works in a better way. Remove it. Link: https://lkml.kernel.org/r/20250306175908.66300-12-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 07da218 commit cedee98

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

include/linux/damon.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,6 @@ struct damon_operations {
604604
* struct damon_callback - Monitoring events notification callbacks.
605605
*
606606
* @after_wmarks_check: Called after each schemes' watermarks check.
607-
* @after_sampling: Called after each sampling.
608607
* @after_aggregation: Called after each aggregation.
609608
* @before_damos_apply: Called before applying DAMOS action.
610609
* @before_terminate: Called before terminating the monitoring.
@@ -617,17 +616,15 @@ struct damon_operations {
617616
* attributes of the monitoring context while it's deactivated due to the
618617
* watermarks, this is the good place to do.
619618
*
620-
* The monitoring thread calls @after_sampling and @after_aggregation for each
621-
* of the sampling intervals and aggregation intervals, respectively.
622-
* Therefore, users can safely access the monitoring results without additional
623-
* protection. For the reason, users are recommended to use these callback for
624-
* the accesses to the results.
619+
* The monitoring thread calls @after_aggregation for each of the aggregation
620+
* intervals. Therefore, users can safely access the monitoring results
621+
* without additional protection. For the reason, users are recommended to use
622+
* these callback for the accesses to the results.
625623
*
626624
* If any callback returns non-zero, monitoring stops.
627625
*/
628626
struct damon_callback {
629627
int (*after_wmarks_check)(struct damon_ctx *context);
630-
int (*after_sampling)(struct damon_ctx *context);
631628
int (*after_aggregation)(struct damon_ctx *context);
632629
int (*before_damos_apply)(struct damon_ctx *context,
633630
struct damon_target *target,

mm/damon/core.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,9 +2432,6 @@ static int kdamond_fn(void *data)
24322432

24332433
if (ctx->ops.prepare_access_checks)
24342434
ctx->ops.prepare_access_checks(ctx);
2435-
if (ctx->callback.after_sampling &&
2436-
ctx->callback.after_sampling(ctx))
2437-
break;
24382435

24392436
kdamond_usleep(sample_interval);
24402437
ctx->passed_sample_intervals++;

0 commit comments

Comments
 (0)