From: Enze Li <lienze@kylinos.cn>
To: sj@kernel.org
Cc: damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, enze.li@gmx.com,
Enze Li <lienze@kylinos.cn>
Subject: [PATCH] samples/damon/mtier: use damon_addr_range consistently
Date: Mon, 20 Jul 2026 17:23:55 +0800 [thread overview]
Message-ID: <20260720092355.237599-1-lienze@kylinos.cn> (raw)
The DAMON provides struct damon_addr_range for unified address range
management. However, the mtier sample still defines a local struct
region_range with an identical layout (start and end as phys_addr_t) and
mixes its usage with struct damon_addr_range in
damon_sample_mtier_build_ctx().
This patch removes the local struct region_range and changes the
parameter type of nid_to_phys() to struct damon_addr_range.
Signed-off-by: Enze Li <lienze@kylinos.cn>
---
samples/damon/mtier.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/samples/damon/mtier.c b/samples/damon/mtier.c
index ac9c24b92ead..67f20b52dc7b 100644
--- a/samples/damon/mtier.c
+++ b/samples/damon/mtier.c
@@ -52,12 +52,7 @@ module_param(detect_node_addresses, bool, 0600);
static struct damon_ctx *ctxs[2];
-struct region_range {
- phys_addr_t start;
- phys_addr_t end;
-};
-
-static int nid_to_phys(int target_node, struct region_range *range)
+static int nid_to_phys(int target_node, struct damon_addr_range *range)
{
if (!node_online(target_node)) {
pr_err("NUMA node %d is not online\n", target_node);
@@ -78,8 +73,7 @@ static struct damon_ctx *damon_sample_mtier_build_ctx(bool promote)
struct damos *scheme;
struct damos_quota_goal *quota_goal;
struct damos_filter *filter;
- struct region_range addr;
- struct damon_addr_range range;
+ struct damon_addr_range range, addr;
int ret;
ctx = damon_new_ctx();
base-commit: c872b70f5d6c742ad34b8e838c92af81c8920b3e
--
2.47.3
reply other threads:[~2026-07-20 9:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260720092355.237599-1-lienze@kylinos.cn \
--to=lienze@kylinos.cn \
--cc=damon@lists.linux.dev \
--cc=enze.li@gmx.com \
--cc=linux-kernel@vger.kernel.org \
--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