* [PATCH mm-unstable] mm/damon/core: setup damos->{core,ops}_filters_default_reject for initial start
@ 2025-03-15 22:26 SeongJae Park
0 siblings, 0 replies; only message in thread
From: SeongJae Park @ 2025-03-15 22:26 UTC (permalink / raw)
To: Andrew Morton; +Cc: SeongJae Park, damon, kernel-team, linux-kernel, linux-mm
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(-)
diff --git a/mm/damon/core.c b/mm/damon/core.c
index db357892da74..fc1eba3da419 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -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);
base-commit: dba212acaa779ea422b1c0653951af5fdf837314
--
2.39.5
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-03-15 22:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-15 22:26 [PATCH mm-unstable] mm/damon/core: setup damos->{core,ops}_filters_default_reject for initial start SeongJae Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox