From: SJ Park <sj@kernel.org>
Cc: SJ Park <sj@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
damon@lists.linux.dev, linux-mm@kvack.org
Subject: [RFC PATCH 1/2] mm/damon/core: expose damon_has_probe_weights()
Date: Sun, 29 Nov 2026 16:15:28 -0800 [thread overview]
Message-ID: <20261130001530.173703-2-sj@kernel.org> (raw)
In-Reply-To: <20261130001530.173703-1-sj@kernel.org>
When a DAMON context is configured with data attribute probe weights, it
runs in attributes only monitoring mode. In the mode, the traditional
page idleness based access monitoring is skipped.
Users could manually do effectively the same thing in more flexible
ways. They can use a set_pgidle probe prep and a pgidle_unset probe
filter, with flexible setup of additional probes. The API callers
should use the probe_hits instead of the traditional access frequency
counter (nr_acceses), though. Some callers such as DAMOS quota region
prioritization score logic would need to be aware of the mode. There is
no core API for knowing if it is in the mode, though. Expose
damon_has_probe_weights(), which is effectively working for the purpose,
to DAMON core API callers.
Signed-off-by: SJ Park <sj@kernel.org>
---
include/linux/damon.h | 1 +
mm/damon/core.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/linux/damon.h b/include/linux/damon.h
index 45c82f536da5..99f57add0106 100644
--- a/include/linux/damon.h
+++ b/include/linux/damon.h
@@ -1195,6 +1195,7 @@ bool damon_initialized(void);
int damon_start(struct damon_ctx **ctxs, int nr_ctxs, bool exclusive);
void damon_stop(struct damon_ctx **ctxs, int nr_ctxs);
bool damon_is_running(struct damon_ctx *ctx);
+bool damon_has_probe_weights(struct damon_ctx *ctx);
int damon_kdamond_pid(struct damon_ctx *ctx);
int damon_call(struct damon_ctx *ctx, struct damon_call_control *control);
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 5eac19ed99b1..96a95f06eb73 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -271,7 +271,7 @@ static struct damon_probe *damon_nth_probe(int n, struct damon_ctx *ctx)
return NULL;
}
-static bool damon_has_probe_weights(struct damon_ctx *c)
+bool damon_has_probe_weights(struct damon_ctx *c)
{
struct damon_probe *p;
--
2.47.3
next prev parent reply other threads:[~2026-11-30 0:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 0:15 [RFC PATCH 0/2] mm/damon: improve DAMOS quota region prioritization in attr-only mode SJ Park
2026-11-30 0:15 ` SJ Park [this message]
2026-11-30 0:15 ` [RFC PATCH 2/2] mm/damon/ops-common: use probe hits weighted sum for hotness SJ 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=20261130001530.173703-2-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=linux-mm@kvack.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