Skip to contentSkip to conversation

mm/damon/stat: deduplicate intervals_goal setup in damon_stat_build_ctx()

PATCH In review JaeJoon Jung 3 participants 5 messages Dec 6, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 mm/damon/stat: deduplicate intervals_goal setup in damon_stat_build_ctx()

The damon_stat_build_ctx() function sets the values of 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
index bf8626859902..51dd29685915 100644
@@ -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
maintainer
#1 lore raw
Quoted 8 lines · On Sat, 6 Dec 2025 10:17:13 +0900 JaeJoon Jung <[email protected]> wrote:

The damon_stat_build_ctx() function sets the values of 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.

I show Enze did suggest changes [1] to v2 of this patch. But I don't show Enze gave Reviewed-by: tag to the patch. Am I missing something?

[1] https://lore.kernel.org/875xal44lf.fsf@

Quoted 1 line

Thanks,
SJ

[...]

#2 lore raw
Quoted 9 lines · SeongJae Park
Quoted 6 lines · On Sat, 6 Dec 2025 10:17:13 +0900 JaeJoon Jung <[email protected]> wrote:

The damon_stat_build_ctx() function sets the values of 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.

Quoted 5 lines
Quoted 2 lines

I show Enze did suggest changes [1] to v2 of this patch. But I don't show Enze gave Reviewed-by: tag to the patch. Am I missing something?

I added "Reviewed-by: Enze".
It is just minor commit message format suggestion. Am I putting too much emphasis on this? Should I delete "Reviewed-by: Enze"?

Quoted 10 lines

[1] https://lore.kernel.org/875xal44lf.fsf@

Quoted 1 line

Thanks,
SJ

[...]

Reviewed-by
#3 lore raw
Quoted 13 lines · JaeJoon Jung
Quoted 12 lines · SeongJae Park
Quoted 8 lines · On Sat, 6 Dec 2025 10:17:13 +0900 JaeJoon Jung <[email protected]> wrote:

The damon_stat_build_ctx() function sets the values of 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.

Quoted 7 lines
Quoted 2 lines

I show Enze did suggest changes [1] to v2 of this patch. But I don't show Enze gave Reviewed-by: tag to the patch. Am I missing something?

I added "Reviewed-by: Enze".
It is just minor commit message format suggestion. Am I putting too much emphasis on this? Should I delete "Reviewed-by: Enze"?

I have carefully reviewed both the commit message and the code changes in the patch, it looks good to me.

Feel free to add,

Thanks,
Enze

<...>

maintainer
#4 lore raw
Quoted 14 lines · On Sat, 6 Dec 2025 15:58:45 +0800 Enze Li <[email protected]> wrote:
Quoted 13 lines · JaeJoon Jung
Quoted 12 lines · SeongJae Park
Quoted 8 lines · On Sat, 6 Dec 2025 10:17:13 +0900 JaeJoon Jung <[email protected]> wrote:

The damon_stat_build_ctx() function sets the values of 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.

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

I show Enze did suggest changes [1] to v2 of this patch. But I don't show Enze gave Reviewed-by: tag to the patch. Am I missing something?

I added "Reviewed-by: Enze".
It is just minor commit message format suggestion. Am I putting too much emphasis on this?

Reviewed-by: tags are kind of approval. Those should be offered by the reviewer. Please refert to the doc [1] for more details.

[1] https://origin.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes

Quoted 1 line
Quoted 1 line

Should I delete "Reviewed-by: Enze"?

Because Enze offered the tag below, no change is needed.

Quoted 7 lines

I have carefully reviewed both the commit message and the code changes in the patch, it looks good to me.

Feel free to add,

Thank you for your review, Enze.

Thanks,
SJ

[...]