Skip to contentSkip to conversation

mm-damon-core-extend-probe_hits_wsum-for-moving-sum-based-calculation.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Oct 9

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/damon/core: extend probe_hits_wsum() for moving sum based calculation
has been removed from the -mm tree. Its filename was
mm-damon-core-extend-probe_hits_wsum-for-moving-sum-based-calculation.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: SJ Park <[email protected]>
Subject: mm/damon/core: extend probe_hits_wsum() for moving sum based calculation
Date: Fri, 11 Sep 2026 06:55:04 -0700

damon_probe_hits_wsum() is being called only in aggregation time. In future, it could also be used by DAMOS. In this case, since DAMOS uses its own apply_interval, it could be called in sampling time. Then using the not yet fully aggregated probe_hits could result in suboptimum outcomes. Extend damon_probe_hits_wsum() to get the weighted sum based on moving sum to prepare the DAMOS usage.

Cc David Hildenbrand <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Liam R. Howlett <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Vlastimil Babka <[email protected]>

---

 include/linux/damon.h |    2 +-
 mm/damon/core.c       |    8 ++++++--
 mm/damon/paddr.c      |    2 +-
 mm/damon/vaddr.c      |    2 +-
 4 files changed, 9 insertions(+), 5 deletions(-)
include/linux/damon.h renamed from include/linux/damon.h~mm-damon-core-extend-probe_hits_wsum-for-moving-sum-based-calculation +1 -1
@@ -1075,7 +1075,7 @@ unsigned int damon_nr_accesses_mvsum(str
 		struct damon_ctx *ctx);
 unsigned char damon_probe_hits_mvsum(int probe_idx, struct damon_region *r,
 		struct damon_ctx *ctx);
-unsigned int damon_probe_hits_wsum(struct damon_region *r, bool last,
+unsigned int damon_probe_hits_wsum(struct damon_region *r, bool last, bool mv,
 		struct damon_ctx *ctx);
 
 int damon_set_regions(struct damon_target *t, struct damon_addr_range *ranges,
mm/damon/core.c renamed from mm/damon/core.c~mm-damon-core-extend-probe_hits_wsum-for-moving-sum-based-calculation +6 -2
@@ -469,11 +469,12 @@ static bool damon_is_last_region(struct
  * damon_probe_hits_wsum() - Returns probe hits weighted sum of a region.
  * @r:		region to get the weighted sum of.
  * @last:	if the request is for last-window aggregated probe hits.
+ * @mv:		use moving sum.
  * @ctx:	context of &r.
  *
  * Return: the weighted sum of probe hits of the region.
  */
-unsigned int damon_probe_hits_wsum(struct damon_region *r, bool last,
+unsigned int damon_probe_hits_wsum(struct damon_region *r, bool last, bool mv,
 		struct damon_ctx *ctx)
 {
 	struct damon_probe *probe;
@@ -483,6 +484,9 @@ unsigned int damon_probe_hits_wsum(struc
 	damon_for_each_probe(probe, ctx) {
 		if (last)
 			sum += r->last_probe_hits[i++] * probe->weight;
+		else if (mv)
+			sum += damon_probe_hits_mvsum(i++, r, ctx) *
+				probe->weight;
 		else
 			sum += r->probe_hits[i++] * probe->weight;
 	}
@@ -3472,7 +3476,7 @@ static unsigned int damon_merge_score(st
 		struct damon_ctx *ctx, bool use_probe_hits)
 {
 	if (use_probe_hits)
-		return damon_probe_hits_wsum(r, last, ctx);
+		return damon_probe_hits_wsum(r, last, false, ctx);
 	if (last)
 		return r->last_nr_accesses;
 	return r->nr_accesses;
mm/damon/paddr.c renamed from mm/damon/paddr.c~mm-damon-core-extend-probe_hits_wsum-for-moving-sum-based-calculation +1 -1
@@ -208,7 +208,7 @@ static unsigned int damon_pa_apply_probe
 				folio_put(folio);
 			if (return_max_wsum)
 				max_wsum = max(damon_probe_hits_wsum(r, false,
-							ctx), max_wsum);
+							false, ctx), max_wsum);
 		}
 	}
 	return max_wsum;
mm/damon/vaddr.c renamed from mm/damon/vaddr.c~mm-damon-core-extend-probe_hits_wsum-for-moving-sum-based-calculation +1 -1
@@ -711,7 +711,7 @@ static unsigned int damon_va_apply_probe
 			__damon_va_apply_probes(ctx, mm, r);
 			if (return_max_wsum)
 				max_wsum = max(damon_probe_hits_wsum(r, false,
-							ctx), max_wsum);
+							false, ctx), max_wsum);
 		}
 		if (mm)
 			mmput(mm);

_

Patches currently in -mm which might be from [email protected] are

mm-damon-sysfs-schemes-read-sysfs_filter-addr_range-only-once.patch mm-damon-sysfs-schemes-read-sysfs_filter-sz_range-only-once.patch mm-damon-core-return-an-error-from-damos_commit_filter_arg.patch mm-damon-core-disallow-max-min-damos-filter-range-arguments-commit.patch mm-damon-sysfs-schemes-drop-centralized-filter-range-arg-validations.patch mm-damon-sysfs-schemes-use-switch-case-in-add_scheme_filters.patch mm-damon-core-kunit-extend-damos_commit_filter_for-for-wrong-input.patch mm-damon-core-kunit-test-invalid-damos-filter-commits.patch mm-damon-api-introduce-damon_filter_type_hugepage_size.patch mm-damon-core-commit-hugepage_size-type-damon-filter.patch mm-damon-ops-common-support-hugepage_size-damon-filter-matching.patch mm-damon-sysfs-add-minmax-files-under-probe-filter-directory.patch mm-damon-sysfs-support-hugepage_size-probe-filter.patch docs-mm-damon-design-update-for-hugepage_size-probe-filter.patch docs-admin-guide-mm-damon-usage-update-for-hugepage_size.patch docs-abi-damon-update-for-hugepage_size-probe-filter.patch mm-damon-api-remove-nr_damos_filter_types.patch mm-damon-core-use-abs_diff-in-damon_feed_loop_next_input.patch mm-damon-core-use-mult_frac-in-damon_feed_loop_next_input.patch mm-damon-core-set-damon_ctx-walk_control_obsolete-in-damon_new_ctx.patch mm-damon-core-document-damon_call-damon_start-race-hang-issue.patch mm-damon-paddr-remove-pa-parameter-from-damon_pa_filter_pass.patch mm-damon-tests-core-kunit-test-eligible_mem_bp-commitment.patch mm-damon-tests-core-kunit-add-probe_hits_wsum-damos-filter-commit-test.patch selftests-damon-sysfs_memcg_path_leak-fail-only-for-real-damon-leak.patch docs-mm-damon-design-clarify-bp-is-basis-point.patch mm-damon-core-introduce-damos_quota_goal-complement.patch mm-damon-core-add-complement-argument-to-damos_new_quota_goal.patch mm-damon-sysfs-schemes-support-quota-goal-complement-flag.patch mm-damon-tests-core-kunit-test-quota_goal-complement-commit.patch selftests-damon-sysfssh-test-quota-goal-complement-flag-file.patch docs-mm-damon-design-document-damos-quota-goal-complement-flag.patch docs-admin-guide-mm-damon-usage-update-for-quota-goal-complement-file.patch docs-abi-damon-update-for-quota-goal-metric-complement-sysfs-file.patch