mm/damon/stat: deduplicate intervals_goal setup in damon_stat_build_ctx()
Subsystems (2)
PATCH v2 1/1 mm/damon/stat: deduplicate intervals_goal setup in 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.
--- 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
Hello JaeJoon,
Thanks for your patch! I've a trivial comment inline, see below.
Quoted 6 lines · Jung-JaeJoon
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.
Would you mind reformatting the patch description? The kernel community documentation recommends wrapping lines at 75 columns [1]. While the current length is within the limit, adjusting it for more balanced line lengths would improve readability. Also, I suggest using two spaces after a period instead of a line break.
[1] https://www.kernel.org/doc/html/latest/process/submitting-patches.html#subject-line
Thanks,
Enze
Quoted 25 lines
Signed-off-by Jung-JaeJoon <[email protected]>Reviewed-by SeongJae Park <[email protected]>--- 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;
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hello Enze,
Thank you for your kind help. I will reflect it in v3 and send it again.
Thanks,
JaeJoon
Quoted 50 lines · Enze Li
Hello JaeJoon,
Thanks for your patch! I've a trivial comment inline, see below.
Quoted 6 lines · Jung-JaeJoon
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.Would you mind reformatting the patch description? The kernel community documentation recommends wrapping lines at 75 columns [1]. While the current length is within the limit, adjusting it for more balanced line lengths would improve readability. Also, I suggest using two spaces after a period instead of a line break.
[1] https://www.kernel.org/doc/html/latest/process/submitting-patches.html#subject-line
Thanks,
EnzeQuoted 25 lines
Signed-off-by Jung-JaeJoon <[email protected]>Reviewed-by SeongJae Park <[email protected]>--- 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;