Re: [RFC PATCH 0/2] samples/damon: improve expression of target region in mtier

From: SeongJae Park
Date: Tue Jul 01 2025 - 19:45:47 EST


Hello Yunjeong,


On Tue, 1 Jul 2025 17:54:15 +0900 Yunjeong Mun <yunjeong.mun@xxxxxx> wrote:

> `mtier` module is a static module for migrating pages using
> damos_action: DAMOS_MIGRATE_HOT and DAMOS_MIGRATE_COLD. Currently,
> this module is built on the assumption that the system has two NUMA
> nodes, where node0 is the fast-tier and node1 is slow-tier. This
> patchset aims to make the expression of the migration target region
> more user-friendly by :

Thank you for your continued patches! Let me clarify my humble opinions about
what is the goal of mtier, and what improvements it needs first, though.

mtier is not intended to be used as a solution for real world usages but a
sample module for helping developers understand how they can utilize DAMON by
calling its API functions. If someone is looking for a real world DAMON-based
memory tiering solution, I think it should be under mm/damon/ directory like
DAMON_RECLAIM, not under samples/damon/ directory.

I hence think we should more focus on making mtier provides good example usages
of DAMON API functions, more than its user-space usages. We could of course
improve its user-space interface if it helps experimental run of it for better
understanding of the code and DAMON API usages. But in my opinion, it should
avoid a case that it result in adding more complicated code that makes reading
of the example difficult.

Please let me know if you have different opinions and I'm missing something.

>From that perspective, I think the assumption of the fast node0 and the slow
node1 is not a particular problem but helps keeping the sample code easier to
read. Of course it has rooms to improve, like having more documentation or
better names and cleaner code.

> 1) allowing users to specify just the node id,
> instead of physical address, and 2) adding two new knobs.
>
> Patch 1 removes four knobs, `node#_start_addr` and `node#_end_addr`, which
> previously required users to input the physical address of the region.
> It introduces logic to conver NUMA node ids to physical address.

I think this is good change. But even though mtier is a sample module, I'd
like to keep the old usages not broken if possible. I'll leave more comments
on it as a reply to the patch.

>
> Patch 2 introduces two new knobs `migrate_hot` and `migrate_cold`, which
> specify the source and destination node ids in a comma-separated format.

As mentioned abovely, I think the assumption of the fast node0 and the slow
node1 is particularly bad, so I'm sorry but I'm not really exciting with this
change. I'll leave more comments as a reply to the patch.

>
> Yunjeong Mun (2):
> samples/damon: convert node id to physical address
> samples/damon: add `migrate_hot` and `migrate_cold` knobs
>
> samples/damon/mtier.c | 108 ++++++++++++++++++++++++++++++++++++------
> 1 file changed, 93 insertions(+), 15 deletions(-)
>
>
> base-commit: db16fe88cdf83a1e7fdf75de282025b6ad61d08f
> --
> 2.34.1


Thanks,
SJ