* [PATCH] mm/damon: Remove duplicate attrs.intervals_goal at the damon_stat_build_ctx()
@ 2025-12-03 3:33 Jung-JaeJoon
2025-12-03 4:27 ` SeongJae Park
0 siblings, 1 reply; 3+ messages in thread
From: Jung-JaeJoon @ 2025-12-03 3:33 UTC (permalink / raw)
To: sj; +Cc: Jung-JaeJoon, linux-mm, rgbi3307
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:
Signed-off-by: Jung-JaeJoon <rgbi3307@gmail.com>
---
mm/damon/stat.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/mm/damon/stat.c b/mm/damon/stat.c
index bf8626859902..51dd29685915 100644
--- a/mm/damon/stat.c
+++ b/mm/damon/stat.c
@@ -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;
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mm/damon: Remove duplicate attrs.intervals_goal at the damon_stat_build_ctx()
2025-12-03 3:33 [PATCH] mm/damon: Remove duplicate attrs.intervals_goal at the damon_stat_build_ctx() Jung-JaeJoon
@ 2025-12-03 4:27 ` SeongJae Park
2025-12-03 7:54 ` JaeJoon Jung
0 siblings, 1 reply; 3+ messages in thread
From: SeongJae Park @ 2025-12-03 4:27 UTC (permalink / raw)
To: Jung-JaeJoon; +Cc: SeongJae Park, linux-mm, rgbi3307, damon
+ damon@lists.linux.dev
Please Cc damon@lists.linux.dev for DAMON patches from next time.
On Wed, 3 Dec 2025 12:33:48 +0900 Jung-JaeJoon <rgbi3307@gmail.com> wrote:
> 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.
Thank you for finding and fixing this!
> 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?
>
> Signed-off-by: Jung-JaeJoon <rgbi3307@gmail.com>
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 <sj@kernel.org>
> ---
> mm/damon/stat.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/mm/damon/stat.c b/mm/damon/stat.c
> index bf8626859902..51dd29685915 100644
> --- a/mm/damon/stat.c
> +++ b/mm/damon/stat.c
> @@ -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;
>
> --
> 2.43.0
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mm/damon: Remove duplicate attrs.intervals_goal at the damon_stat_build_ctx()
2025-12-03 4:27 ` SeongJae Park
@ 2025-12-03 7:54 ` JaeJoon Jung
0 siblings, 0 replies; 3+ messages in thread
From: JaeJoon Jung @ 2025-12-03 7:54 UTC (permalink / raw)
To: SeongJae Park; +Cc: linux-mm, rgbi3307, damon
Hi, SeongJae Park,
Thank you for your kind reply.
I will send you the v2 patch incorporating the advice you provided above.
Thanks.
On Wed, 3 Dec 2025 at 13:27, SeongJae Park <sj@kernel.org> wrote:
>
> + damon@lists.linux.dev
>
> Please Cc damon@lists.linux.dev for DAMON patches from next time.
>
> On Wed, 3 Dec 2025 12:33:48 +0900 Jung-JaeJoon <rgbi3307@gmail.com> wrote:
>
> > 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.
>
> Thank you for finding and fixing this!
>
> > 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?
>
> >
> > Signed-off-by: Jung-JaeJoon <rgbi3307@gmail.com>
>
> 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 <sj@kernel.org>
>
> > ---
> > mm/damon/stat.c | 8 --------
> > 1 file changed, 8 deletions(-)
> >
> > diff --git a/mm/damon/stat.c b/mm/damon/stat.c
> > index bf8626859902..51dd29685915 100644
> > --- a/mm/damon/stat.c
> > +++ b/mm/damon/stat.c
> > @@ -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;
> >
> > --
> > 2.43.0
>
>
> Thanks,
> SJ
>
> [...]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-12-03 7:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-03 3:33 [PATCH] mm/damon: Remove duplicate attrs.intervals_goal at the damon_stat_build_ctx() Jung-JaeJoon
2025-12-03 4:27 ` SeongJae Park
2025-12-03 7:54 ` JaeJoon Jung
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox