@@ -525,7 +525,7 @@ struct damon_ctx *damon_new_ctx(void)
ctx->attrs.ops_update_interval = 60 * 1000 * 1000;
ctx->passed_sample_intervals = 0;
- /* These will be set from kdamond_init_intervals_sis() */
+ /* These will be set from kdamond_init_ctx() */
ctx->next_aggregation_sis = 0;
ctx->next_ops_update_sis = 0;
@@ -2363,7 +2363,7 @@ static int kdamond_wait_activation(struct damon_ctx *ctx)
return -EBUSY;
}
-static void kdamond_init_intervals_sis(struct damon_ctx *ctx)
+static void kdamond_init_ctx(struct damon_ctx *ctx)
{
unsigned long sample_interval = ctx->attrs.sample_interval ?
ctx->attrs.sample_interval : 1;
@@ -2381,6 +2381,7 @@ static void kdamond_init_intervals_sis(struct damon_ctx *ctx)
apply_interval = scheme->apply_interval_us ?
scheme->apply_interval_us : ctx->attrs.aggr_interval;
scheme->next_apply_sis = apply_interval / sample_interval;
+ damos_set_filters_default_reject(scheme);
}
}
@@ -2398,7 +2399,7 @@ static int kdamond_fn(void *data)
pr_debug("kdamond (%d) starts\n", current->pid);
complete(&ctx->kdamond_started);
- kdamond_init_intervals_sis(ctx);
+ kdamond_init_ctx(ctx);
if (ctx->ops.init)
ctx->ops.init(ctx);
Commit 6a0f07289bc7 ("mm/damon/core: set damos_filter default allowance behavior based on installed filters") on mm-unstable sets damos->{core,ops}_filters_default_reject fields on only damon_commit_ctx() code path, which is called for only online parameters update. Hence, users who set filters from the beginning could set it not properly initialized. As a result, unnnecessarily DAMOS target regions can be rejected. Set the fields at the beginning of DAMON worker thread execution, too. Fixes: 6a0f07289bc7 ("mm/damon/core: set damos_filter default allowance behavior based on installed filters") # mm-unstable Signed-off-by: SeongJae Park <sj@kernel.org> --- mm/damon/core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) base-commit: dba212acaa779ea422b1c0653951af5fdf837314