From: Enze Li <lienze@kylinos.cn>
To: sj@kernel.org, akpm@linux-foundation.org
Cc: damon@lists.linux.dev, linux-mm@kvack.org, enze.li@gmx.com,
Enze Li <lienze@kylinos.cn>
Subject: [PATCH 1/2] mm/damon/core: export necessary symbols
Date: Mon, 15 Dec 2025 22:20:56 +0800 [thread overview]
Message-ID: <20251215142057.588500-2-lienze@kylinos.cn> (raw)
In-Reply-To: <20251215142057.588500-1-lienze@kylinos.cn>
This patch exports necessary DAMON core symbols to allow building
loadable kernel modules that leverage DAMON's monitoring capabilities
for advanced memory management techniques, such as proactive
reclamation.
The exported functions include those for context creation/destruction,
target and scheme management, and monitoring control. This enables
external modules to create dedicated DAMON contexts and targets,
operation schemes, and control the monitoring lifecycle without
requiring direct modifications to the core DAMON subsystem.
Signed-off-by: Enze Li <lienze@kylinos.cn>
---
mm/damon/core.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/mm/damon/core.c b/mm/damon/core.c
index f9fc0375890a..b3f6b36a034d 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -108,6 +108,7 @@ int damon_select_ops(struct damon_ctx *ctx, enum damon_ops_id id)
mutex_unlock(&damon_ops_lock);
return err;
}
+EXPORT_SYMBOL_GPL(damon_select_ops);
/*
* Construct a damon_region struct
@@ -409,6 +410,7 @@ struct damos *damon_new_scheme(struct damos_access_pattern *pattern,
return scheme;
}
+EXPORT_SYMBOL_GPL(damon_new_scheme);
static void damos_set_next_apply_sis(struct damos *s, struct damon_ctx *ctx)
{
@@ -478,11 +480,13 @@ struct damon_target *damon_new_target(void)
return t;
}
+EXPORT_SYMBOL_GPL(damon_new_target);
void damon_add_target(struct damon_ctx *ctx, struct damon_target *t)
{
list_add_tail(&t->list, &ctx->adaptive_targets);
}
+EXPORT_SYMBOL_GPL(damon_add_target);
bool damon_targets_empty(struct damon_ctx *ctx)
{
@@ -553,6 +557,7 @@ struct damon_ctx *damon_new_ctx(void)
return ctx;
}
+EXPORT_SYMBOL_GPL(damon_new_ctx);
static void damon_destroy_targets(struct damon_ctx *ctx)
{
@@ -573,6 +578,7 @@ void damon_destroy_ctx(struct damon_ctx *ctx)
kfree(ctx);
}
+EXPORT_SYMBOL_GPL(damon_destroy_ctx);
static bool damon_attrs_equals(const struct damon_attrs *attrs1,
const struct damon_attrs *attrs2)
@@ -763,6 +769,7 @@ void damon_set_schemes(struct damon_ctx *ctx, struct damos **schemes,
for (i = 0; i < nr_schemes; i++)
damon_add_scheme(ctx, schemes[i]);
}
+EXPORT_SYMBOL_GPL(damon_set_schemes);
static struct damos_quota_goal *damos_nth_quota_goal(
int n, struct damos_quota *q)
@@ -1371,6 +1378,7 @@ int damon_start(struct damon_ctx **ctxs, int nr_ctxs, bool exclusive)
return err;
}
+EXPORT_SYMBOL_GPL(damon_start);
/*
* __damon_stop() - Stops monitoring of a given context.
@@ -1414,6 +1422,7 @@ int damon_stop(struct damon_ctx **ctxs, int nr_ctxs)
}
return err;
}
+EXPORT_SYMBOL_GPL(damon_stop);
/**
* damon_is_running() - Returns if a given DAMON context is running.
@@ -2924,6 +2933,7 @@ bool damon_initialized(void)
{
return damon_region_cache != NULL;
}
+EXPORT_SYMBOL_GPL(damon_initialized);
static int __init damon_init(void)
{
--
2.43.0
next prev parent reply other threads:[~2025-12-15 14:22 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-15 14:20 [PATCH 0/2] mm/damon: export symbols and introduce prdm module Enze Li
2025-12-15 14:20 ` Enze Li [this message]
2025-12-15 14:20 ` [PATCH 2/2] mm/damon/modules: introduce prdm module for DAMON Enze Li
2025-12-15 23:16 ` [PATCH 0/2] mm/damon: export symbols and introduce prdm module SeongJae Park
2025-12-18 13:46 ` Enze Li
2025-12-19 11:46 ` SeongJae Park
2025-12-21 2:42 ` JaeJoon Jung
2025-12-21 8:12 ` SeongJae Park
2025-12-21 11:04 ` JaeJoon Jung
2025-12-21 19:27 ` SeongJae Park
2025-12-22 20:57 ` JaeJoon Jung
2025-12-22 21:33 ` SeongJae Park
2025-12-22 7:08 ` Enze Li
2025-12-22 15:21 ` 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=20251215142057.588500-2-lienze@kylinos.cn \
--to=lienze@kylinos.cn \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=enze.li@gmx.com \
--cc=linux-mm@kvack.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox