From: SeongJae Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SeongJae Park <sj@kernel.org>,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
Steven Rostedt <rostedt@goodmis.org>,
damon@lists.linux.dev, kernel-team@meta.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-trace-kernel@vger.kernel.org
Subject: [PATCH 1/2] mm/damon: add trace event for auto-tuned monitoring intervals
Date: Fri, 4 Jul 2025 15:14:07 -0700 [thread overview]
Message-ID: <20250704221408.38510-2-sj@kernel.org> (raw)
In-Reply-To: <20250704221408.38510-1-sj@kernel.org>
Aim-oriented monitoring intervals auto-tuning is an important and
recommended feature for DAMON users. Add a trace event for the
observability of the tuned intervals and tuning itself.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
include/trace/events/damon.h | 17 +++++++++++++++++
mm/damon/core.c | 1 +
2 files changed, 18 insertions(+)
diff --git a/include/trace/events/damon.h b/include/trace/events/damon.h
index da4bd9fd1162..32c611076023 100644
--- a/include/trace/events/damon.h
+++ b/include/trace/events/damon.h
@@ -48,6 +48,23 @@ TRACE_EVENT_CONDITION(damos_before_apply,
__entry->nr_accesses, __entry->age)
);
+TRACE_EVENT(damon_monitor_intervals_tune,
+
+ TP_PROTO(unsigned long sample_us),
+
+ TP_ARGS(sample_us),
+
+ TP_STRUCT__entry(
+ __field(unsigned long, sample_us)
+ ),
+
+ TP_fast_assign(
+ __entry->sample_us = sample_us;
+ ),
+
+ TP_printk("sample_us=%lu", __entry->sample_us)
+);
+
TRACE_EVENT(damon_aggregated,
TP_PROTO(unsigned int target_id, struct damon_region *r,
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 979b29e16ef4..57a1ace4d10d 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -1490,6 +1490,7 @@ static void kdamond_tune_intervals(struct damon_ctx *c)
new_attrs.sample_interval);
new_attrs.aggr_interval = new_attrs.sample_interval *
c->attrs.aggr_samples;
+ trace_damon_monitor_intervals_tune(new_attrs.sample_interval);
damon_set_attrs(c, &new_attrs);
}
--
2.39.5
next prev parent reply other threads:[~2025-07-04 22:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-04 22:14 [PATCH 0/2] mm/damon: add trace events for auto-tuned monitoring intervals and DAMOS quota SeongJae Park
2025-07-04 22:14 ` SeongJae Park [this message]
2025-07-04 22:14 ` [PATCH 2/2] mm/damon: add trace event for effective size quota SeongJae Park
2025-07-09 16:21 ` Steven Rostedt
2025-07-09 18:28 ` SeongJae Park
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=20250704221408.38510-2-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).