From: SeongJae Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Yunjeong Mun <yunjeong.mun@sk.com>, SeongJae Park <sj@kernel.org>,
damon@lists.linux.dev, kernel-team@meta.com,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Honggyu Kim <honggyu.kim@sk.com>
Subject: [PATCH RESEND] samples/damon/mtier: add parameters for node0 memory usage
Date: Fri, 27 Jun 2025 09:33:29 -0700 [thread overview]
Message-ID: <20250627163329.50997-1-sj@kernel.org> (raw)
From: Yunjeong Mun <yunjeong.mun@sk.com>
This patch changes the hard-coded quota goal metric values into sysfs
knobs: `node0_mem_used_bp` and `node0_mem_free_bp`. These knobs
represent the used and free memory ratio of node0 in basis points
(bp, where 1 bp = 0.01%). As mentioned in [1], this patch is developed
under the assumption that node0 is always the fast-tier in a two-tiers
memory setup.
[1] https://lore.kernel.org/linux-mm/20250420194030.75838-8-sj@kernel.org/
Suggested-by: Honggyu Kim <honggyu.kim@sk.com>
Signed-off-by: Yunjeong Mun <yunjeong.mun@sk.com>
Link: https://patch.msgid.link/20250619050313.1535-1-yunjeong.mun@sk.com
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: SeongJae Park <sj@kernel.org>
---
samples/damon/mtier.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/samples/damon/mtier.c b/samples/damon/mtier.c
index 36d2cd933f5a..f3220d6e6739 100644
--- a/samples/damon/mtier.c
+++ b/samples/damon/mtier.c
@@ -24,6 +24,12 @@ module_param(node1_start_addr, ulong, 0600);
static unsigned long node1_end_addr __read_mostly;
module_param(node1_end_addr, ulong, 0600);
+static unsigned long node0_mem_used_bp __read_mostly = 9970;
+module_param(node0_mem_used_bp, ulong, 0600);
+
+static unsigned long node0_mem_free_bp __read_mostly = 50;
+module_param(node0_mem_free_bp, ulong, 0600);
+
static int damon_sample_mtier_enable_store(
const char *val, const struct kernel_param *kp);
@@ -112,7 +118,7 @@ static struct damon_ctx *damon_sample_mtier_build_ctx(bool promote)
quota_goal = damos_new_quota_goal(
promote ? DAMOS_QUOTA_NODE_MEM_USED_BP :
DAMOS_QUOTA_NODE_MEM_FREE_BP,
- promote ? 9970 : 50);
+ promote ? node0_mem_used_bp : node0_mem_free_bp);
if (!quota_goal)
goto free_out;
quota_goal->nid = 0;
base-commit: 12c066f7860c9b980fdc8ccad1f98425b3344bf0
--
2.39.5
reply other threads:[~2025-06-27 16:33 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=20250627163329.50997-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=honggyu.kim@sk.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=yunjeong.mun@sk.com \
/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