All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,sj@kernel.org,akpm@linux-foundation.org
Subject: [folded-merged] samples-damon-implement-a-damon-module-for-memory-tiering-fix.patch removed from -mm tree
Date: Mon, 12 May 2025 23:38:21 -0700	[thread overview]
Message-ID: <20250513063822.1FE07C4CEE4@smtp.kernel.org> (raw)


The quilt patch titled
     Subject: samples/damon/mtier: fix wrong DAMON attrs setting
has been removed from the -mm tree.  Its filename was
     samples-damon-implement-a-damon-module-for-memory-tiering-fix.patch

This patch was dropped because it was folded into samples-damon-implement-a-damon-module-for-memory-tiering.patch

------------------------------------------------------
From: SeongJae Park <sj@kernel.org>
Subject: samples/damon/mtier: fix wrong DAMON attrs setting
Date: Sat, 10 May 2025 15:09:32 -0700

When intervals auto-tuning is enabled, DAMON monitoring attributes should
be set with damon_set_attrs().  Because damon_set_attrs() is the only
place that sets attrs->aggr_samples, not calling damon_set_attrs() can
result in divide-by-zero from damon_get_intervals_score().

mtier, which is a DAMON's sample module that merged in mm-unstable as of
this writing, is not calling the function while enabling the auto-tuning. 
Fix the problem by properly calling damon_set_attrs().

Link: https://lkml.kernel.org/r/20250510220932.47722-1-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 samples/damon/mtier.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

--- a/samples/damon/mtier.c~samples-damon-implement-a-damon-module-for-memory-tiering-fix
+++ a/samples/damon/mtier.c
@@ -41,6 +41,7 @@ static struct damon_ctx *ctxs[2];
 static struct damon_ctx *damon_sample_mtier_build_ctx(bool promote)
 {
 	struct damon_ctx *ctx;
+	struct damon_attrs attrs;
 	struct damon_target *target;
 	struct damon_region *region;
 	struct damos *scheme;
@@ -50,14 +51,24 @@ static struct damon_ctx *damon_sample_mt
 	ctx = damon_new_ctx();
 	if (!ctx)
 		return NULL;
+	attrs = (struct damon_attrs) {
+		.sample_interval = 5 * USEC_PER_MSEC,
+		.aggr_interval = 100 * USEC_PER_MSEC,
+		.ops_update_interval = 60 * USEC_PER_MSEC * MSEC_PER_SEC,
+		.min_nr_regions = 10,
+		.max_nr_regions = 1000,
+	};
+
 	/*
 	 * 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) {
+	attrs.intervals_goal = (struct damon_intervals_goal) {
 		.access_bp = 400, .aggrs = 3,
 		.min_sample_us = 5000, .max_sample_us = 10000000,
 	};
+	if (damon_set_attrs(ctx, &attrs))
+		goto free_out;
 	if (damon_select_ops(ctx, DAMON_OPS_PADDR))
 		goto free_out;
 
_

Patches currently in -mm which might be from sj@kernel.org are

mm-damon-core-introduce-damos-quota-goal-metrics-for-memory-node-utilization.patch
mm-damon-sysfs-schemes-implement-file-for-quota-goal-nid-parameter.patch
mm-damon-sysfs-schemes-connect-damos_quota_goal-nid-with-core-layer.patch
docs-mm-damon-design-document-node_mem_usedfree_bp.patch
docs-admin-guide-mm-damon-usage-document-nid-file.patch
docs-abi-damon-document-nid-file.patch
samples-damon-implement-a-damon-module-for-memory-tiering.patch
mm-damon-core-warn-and-fix-nr_accesses-corruption.patch
mm-damon-sysfs-schemes-fix-wrong-comment-on-damons_sysfs_quota_goal_metric_strs.patch
mm-damon-paddr-remove-unused-variable-folio_list-in-damon_pa_stat.patch
mm-damon-tests-core-kunit-add-a-test-for-damos_set_filters_default_reject.patch
selftests-damon-_damon_sysfs-read-tried-regions-directories-in-order.patch
docs-damon-update-titles-and-brief-introductions-to-explain-damos.patch


             reply	other threads:[~2025-05-13  6:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13  6:38 Andrew Morton [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-05-11  3:56 [folded-merged] samples-damon-implement-a-damon-module-for-memory-tiering-fix.patch removed from -mm tree Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250513063822.1FE07C4CEE4@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=sj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.