[PATCH 1/9] mm/damon/core: remove unnecessary zero-initialization in damon_new_ctx()

From: SJ Park

Date: Mon Nov 02 2026 - 10:43:45 EST


From: "Adrian Huang (Lenovo)" <adrianhuang0701@xxxxxxxxx>

damon_new_ctx() allocates the context structure using kzalloc(),
which already initializes all fields to zero.

The explicit initialization of passed_sample_intervals,
next_aggregation_sis, and next_ops_update_sis is therefore redundant.
In addition, they are later initialized by kdamond_init_ctx() before use.

Remove the unnecessary assignments to simplify the code.

Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Adrian Huang (Lenovo) <adrianhuang0701@xxxxxxxxx>
Reviewed-by: SJ Park <sj@xxxxxxxxxx>
Signed-off-by: SJ Park <sj@xxxxxxxxxx>
---
Changes from v1
- v1: https://lore.kernel.org/20261016143733.320-1-adrianhuang0701@xxxxxxxxx
- Collect R-b: from SJ.
- Rebase to latest mm-new.

mm/damon/core.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/mm/damon/core.c b/mm/damon/core.c
index 7441cdea57dc5..9d54899004026 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -918,11 +918,6 @@ struct damon_ctx *damon_new_ctx(void)
ctx->attrs.aggr_interval = 100 * 1000;
ctx->attrs.ops_update_interval = 60 * 1000 * 1000;

- ctx->passed_sample_intervals = 0;
- /* These will be set from kdamond_init_ctx() */
- ctx->next_aggregation_sis = 0;
- ctx->next_ops_update_sis = 0;
-
mutex_init(&ctx->kdamond_lock);
INIT_LIST_HEAD(&ctx->call_controls);
mutex_init(&ctx->call_controls_lock);
--
2.47.3