mm/damon: Remove duplicate attrs.intervals_goal at the damon_stat_build_ctx()
Subsystems (2)
PATCH 1/1 mm/damon: Remove duplicate attrs.intervals_goal at the damon_stat_build_ctx()
The damon_stat_build_ctx() function sets the values
of attrs.intervals_goal structure members.
These values are applied to damon_ctx in damon_set_attrs(). However, It is resetting the values that were already applied previously to the same values.
I suggest removing this code as it constitutes duplicate execution. Please check the modified code below:
--- mm/damon/stat.c | 8 -------- 1 file changed, 8 deletions(-)
mm/damon/stat.c +0 -8
@@ -173,14 +173,6 @@ static struct damon_ctx *damon_stat_build_ctx(void)if (damon_set_attrs (ctx, &attrs)) goto free_out; -/* -* auto-tune sampling and aggregation interval aiming 4% DAMON-observed -* accesses ratio, keeping sampling interval in [5ms, 10s] range. -*/ - ctx->attrs.intervals_goal = (struct damon_intervals_goal ) { - .access_bp =400 , .aggrs =3 , - .min_sample_us =5000 , .max_sample_us =10000000 , - };if (damon_select_ops (ctx,DAMON_OPS_PADDR )) goto free_out;
Signature · 1 line
2.43.0
Please Cc [email protected] for DAMON patches from next time.
Quoted 6 lines · On Wed, 3 Dec 2025 12:33:48 +0900 Jung-JaeJoon <[email protected]> wrote:
The
damon_stat_build_ctx()function sets the values
of attrs.intervals_goal structure members.
These values are applied todamon_ctxindamon_set_attrs(). However, It is resetting the values that were already applied previously to the same values.
I suggest removing this code as it constitutes duplicate execution.
Thank you for finding and fixing this!
Quoted 1 line
Please check the modified code below:
The above sentence is not needed for normal patch descriptions. Please drop it.
Also, I think the subject could be better describe this change, e.g.,
mm/damon/stat: deduplicate intervals_goal setup in damon_stat_build_ctx()
Could you please make the above suggested changes to this patch and resend the modified version as v2?
Quoted 2 lines
Signed-off-by Jung-JaeJoon <[email protected]>
If you agree to my above trivial suggestions and make the requested changes, please feel free to add below on the v2 patch.
Quoted 25 lines
--- mm/damon/stat.c | 8 -------- 1 file changed, 8 deletions(-)mm/damon/stat.c +0
-8@@ -173,14 +173,6 @@ static struct damon_ctx *damon_stat_build_ctx(void)if (damon_set_attrs (ctx, &attrs)) goto free_out; -/* -* auto-tune sampling and aggregation interval aiming 4% DAMON-observed -* accesses ratio, keeping sampling interval in [5ms, 10s] range. -*/ - ctx->attrs.intervals_goal = (struct damon_intervals_goal ) { - .access_bp =400 , .aggrs =3 , - .min_sample_us =5000 , .max_sample_us =10000000 , - };if (damon_select_ops (ctx,DAMON_OPS_PADDR )) goto free_out;Signature · 1 line
2.43.0
Thanks,
SJ
[...]
Hi, SeongJae Park,
Thank you for your kind reply.
I will send you the v2 patch incorporating the advice you provided above. Thanks.
Quoted 67 lines · SeongJae Park
Please Cc [email protected] for DAMON patches from next time.
Quoted 6 lines · On Wed, 3 Dec 2025 12:33:48 +0900 Jung-JaeJoon <[email protected]> wrote:
The
damon_stat_build_ctx()function sets the values
of attrs.intervals_goal structure members.
These values are applied todamon_ctxindamon_set_attrs(). However, It is resetting the values that were already applied previously to the same values.
I suggest removing this code as it constitutes duplicate execution.Thank you for finding and fixing this!
Quoted 1 line
Please check the modified code below:
The above sentence is not needed for normal patch descriptions. Please drop it.
Also, I think the subject could be better describe this change, e.g.,
mm/damon/stat: deduplicateintervals_goalsetup indamon_stat_build_ctx()Could you please make the above suggested changes to this patch and resend the modified version as v2?
Quoted 2 lines
Signed-off-by Jung-JaeJoon <[email protected]>If you agree to my above trivial suggestions and make the requested changes, please feel free to add below on the v2 patch.
Reviewed-by SeongJae Park <[email protected]>Quoted 24 lines
--- mm/damon/stat.c | 8 -------- 1 file changed, 8 deletions(-)mm/damon/stat.c +0
-9@@ -173,14 +173,6 @@ static struct damon_ctx *damon_stat_build_ctx(void)if (damon_set_attrs (ctx, &attrs)) goto free_out; -/* -* auto-tune sampling and aggregation interval aiming 4% DAMON-observed -* accesses ratio, keeping sampling interval in [5ms, 10s] range. -*/ - ctx->attrs.intervals_goal = (struct damon_intervals_goal ) { - .access_bp =400 , .aggrs =3 , - .min_sample_us =5000 , .max_sample_us =10000000 , - };if (damon_select_ops (ctx,DAMON_OPS_PADDR )) goto free_out; --Quoted 1 line
2.43.0
Thanks,
SJ[...]