Skip to contentSkip to conversation

mm/damon/sysfs-schemes: add use_nodes_of_tier on sysfs-schemes

PATCH Simon Wang (王传国) 2 participants 2 messages May 29, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 21 lines
Quoted 2 lines

This patch adds use_nodes_of_tier under

/sys/kernel/mm/damon/admin/kdamonds/<N>/contexts/<N>/schemes/<N>/

Quoted 3 lines

The 'use_nodes_of_tier' can be used to select nodes within the same memory tier of target_nid for DAMOS actions such as

DAMOS_MIGRATE_{HOT,COLD}.

Could you please elaborate in what setup you think this option is useful, and measurement of the usefulness if you have?

I'm asking the above question because of below reasons. My anticiapted usage of DAMOS_MIGRATE_{HOT,COLD} is for not only memory tiering but generic NUMA node management. And my proposed usage of these for memory tiering is making per-node promotion/demotion for gradually promoting and demoting pages step by step between node. It could be slow but I anticipate such slow but continued promotion/demotion is more important for reliable performance on production systems of large time scale. And I believe the approach can be applied to general NUMA nodes management, once DAMON is extended for per-CPU access monitoring.

Quoted 2 lines

I'm not saying this change is not useful, but asking you to give me a chance to learn your changes, better.

I believe some users may want to ​​use only the target node's memory​​ and reserve other nodes in the same tier for specific applications. Therefore, I added a switch file use_nodes_of_tier. I think it might be better to set the default value of use_nodes_of_tier to true (i.e., allow using fallback nodes). What do you think

Quoted 11 lines
Quoted 10 lines
---
 include/linux/damon.h        |  9 ++++++++-
 include/linux/memory-tiers.h |  5 +++++
 mm/damon/core.c              |  6 ++++--
 mm/damon/lru_sort.c          |  3 ++-
 mm/damon/paddr.c             | 19 ++++++++++++-------
 mm/damon/reclaim.c           |  3 ++-
 mm/damon/sysfs-schemes.c     | 31

++++++++++++++++++++++++++++++-

Quoted 8 lines
Quoted 4 lines
 mm/memory-tiers.c            | 13 +++++++++++++
 samples/damon/mtier.c        |  3 ++-
 samples/damon/prcl.c         |  3 ++-
 10 files changed, 80 insertions(+), 15 deletions(-)

Can we please make this change more separated? Maybe we can split the change for memory-tiers.c, DAMON core layer, and DAMON sysfs interface. That will make review much easier.

Yes,I'll split this patch to be 2 patches.

Quoted 7 lines

I'll add more comments for details after above high level discussion is done.

Thanks,
SJ

[...]

maintainer
#1 lore raw
Quoted 21 lines · On Thu, 29 May 2025 03:12:13 +0000 Simon Wang (王传国) <[email protected]>…
Quoted 21 lines
Quoted 2 lines

This patch adds use_nodes_of_tier under

/sys/kernel/mm/damon/admin/kdamonds/<N>/contexts/<N>/schemes/<N>/

Quoted 3 lines

The 'use_nodes_of_tier' can be used to select nodes within the same memory tier of target_nid for DAMOS actions such as

DAMOS_MIGRATE_{HOT,COLD}.

Could you please elaborate in what setup you think this option is useful, and measurement of the usefulness if you have?

I'm asking the above question because of below reasons. My anticiapted usage of DAMOS_MIGRATE_{HOT,COLD} is for not only memory tiering but generic NUMA node management. And my proposed usage of these for memory tiering is making per-node promotion/demotion for gradually promoting and demoting pages step by step between node. It could be slow but I anticipate such slow but continued promotion/demotion is more important for reliable performance on production systems of large time scale. And I believe the approach can be applied to general NUMA nodes management, once DAMON is extended for per-CPU access monitoring.

Quoted 6 lines
Quoted 2 lines

I'm not saying this change is not useful, but asking you to give me a chance to learn your changes, better.

I believe some users may want to ​​use only the target node's memory​​ and reserve other nodes in the same tier for specific applications. Therefore, I added a switch file use_nodes_of_tier.

Thank you for clarifying, Simon.

Because this is an ABI change that difficult to revert and therefore we may need to support for long term, I'd like to have more clear theory and/or data if possible. In my humble opinion, above clarification doesn't sound like a strong enough justification for ABI change.

More specifically, it would be better if you could answer below questions. Who would be such users, how common the use case would be, and what are the benefit of doing so? Is that only theory? Or, a real existing use case? Can you share measurement of the benefit from this change that measured from real workloads or benchmarks? Is there an alternative way to do this without ABI change?

Quoted 2 lines

I think it might be better to set the default value of use_nodes_of_tier to true (i.e., allow using fallback nodes). What do you think

In my humble opinion, we can consider setting it true by default, if we agree the benefit of the change is significant. With only currently given information, I cannot easily say if I think this can really be useful. As asked abovely, more clear thoery and/or real data would be helpful.

Quoted 17 lines
Quoted 17 lines
Quoted 11 lines
---
 include/linux/damon.h        |  9 ++++++++-
 include/linux/memory-tiers.h |  5 +++++
 mm/damon/core.c              |  6 ++++--
 mm/damon/lru_sort.c          |  3 ++-
 mm/damon/paddr.c             | 19 ++++++++++++-------
 mm/damon/reclaim.c           |  3 ++-
 mm/damon/sysfs-schemes.c     | 31

++++++++++++++++++++++++++++++-

Quoted 4 lines
 mm/memory-tiers.c            | 13 +++++++++++++
 samples/damon/mtier.c        |  3 ++-
 samples/damon/prcl.c         |  3 ++-
 10 files changed, 80 insertions(+), 15 deletions(-)
Quoted 5 lines
Quoted 3 lines

Can we please make this change more separated? Maybe we can split the change for memory-tiers.c, DAMON core layer, and DAMON sysfs interface. That will make review much easier.

Yes,I'll split this patch to be 2 patches.

Thank you for accepting my suggestion. But I think it deserves 3 patches, each for

- memory-tiers.c,
- DAMON core layer, and
- and DAMON sysfs interface.

But, let's further discuss on the high level topic (if this change is really beneficial enough to make ABI change).

Thanks,
SJ

[...]