* [RFC PATCH v2 0/6] mm/damon: add DAMOS_MIGRATE_{HOT,COLD} destination nodes and weights
@ 2025-07-02 5:15 SeongJae Park
2025-07-02 5:15 ` [RFC PATCH v2 6/6] Docs/admin-guide/mm/damon/usage: document dests directory SeongJae Park
0 siblings, 1 reply; 2+ messages in thread
From: SeongJae Park @ 2025-07-02 5:15 UTC (permalink / raw)
Cc: SeongJae Park, Andrew Morton, Bijan Tabatabai, Jonathan Corbet,
damon, kernel-team, linux-doc, linux-kernel, linux-mm
DAMOS_MIGRATE_{HOT,COLD} action can migrate pages to only single node.
It could be useful to allow it migrates pages to multiple nodes with
different weights. A work for dynamic interleaving[1], which is in
progress, is an expected case. We also discussed this could be useful
for memory tiering, e.g., when we want to move pages to multiple noes of
same tier.
Extend the API and ABI for specifying the multiple destination nodes and
their weights.
Note that this RFC is a prototype of the interface change for Bijan's
interleaving work[1]. Hence this patch series is only implementing the
interface part, not the real implementation of the migration behavior.
[1] https://lore.kernel.org/20250620180458.5041-1-bijan311@gmail.com
[2] https://lore.kernel.org/20240408175228.91414-1-sj@kernel.org
Changes from RFC
(https://lore.kernel.org/20250621173131.23917-1-sj@kernel.org)
- Add documentation patches
- Wordsmith commit messages
- Rebase on latest mm-new
SeongJae Park (6):
mm/damon: add struct damos_migrate_dest
mm/damon/core: add damos->migrate_dest field
mm/damon/sysfs-schemes: implement DAMOS action destinations directory
mm/damon/sysfs-schemes: set damos->migrate_dest
Docs/ABI/damon: document schemes dests directory
Docs/admin-guide/mm/damon/usage: document dests directory
.../ABI/testing/sysfs-kernel-mm-damon | 22 ++
Documentation/admin-guide/mm/damon/usage.rst | 33 ++-
include/linux/damon.h | 29 +-
mm/damon/core.c | 4 +
mm/damon/sysfs-schemes.c | 253 +++++++++++++++++-
5 files changed, 333 insertions(+), 8 deletions(-)
base-commit: 8a6d44984fa3076b444a6ddd8a8898b6ba254d25
--
2.39.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* [RFC PATCH v2 6/6] Docs/admin-guide/mm/damon/usage: document dests directory
2025-07-02 5:15 [RFC PATCH v2 0/6] mm/damon: add DAMOS_MIGRATE_{HOT,COLD} destination nodes and weights SeongJae Park
@ 2025-07-02 5:15 ` SeongJae Park
0 siblings, 0 replies; 2+ messages in thread
From: SeongJae Park @ 2025-07-02 5:15 UTC (permalink / raw)
Cc: SeongJae Park, Andrew Morton, Bijan Tabatabai, Jonathan Corbet,
damon, kernel-team, linux-doc, linux-kernel, linux-mm
Document the newly added DAMOS action destination directory of the DAMON
sysfs interface on the usage document.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
Documentation/admin-guide/mm/damon/usage.rst | 33 +++++++++++++++++---
1 file changed, 29 insertions(+), 4 deletions(-)
diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index d960aba72b82..fc5c962353ed 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -85,6 +85,8 @@ comma (",").
│ │ │ │ │ │ │ :ref:`watermarks <sysfs_watermarks>`/metric,interval_us,high,mid,low
│ │ │ │ │ │ │ :ref:`{core_,ops_,}filters <sysfs_filters>`/nr_filters
│ │ │ │ │ │ │ │ 0/type,matching,allow,memcg_path,addr_start,addr_end,target_idx,min,max
+ │ │ │ │ │ │ │ :ref:`dests <damon_sysfs_dests>`/nr_dests
+ │ │ │ │ │ │ │ │ 0/id,weight
│ │ │ │ │ │ │ :ref:`stats <sysfs_schemes_stats>`/nr_tried,sz_tried,nr_applied,sz_applied,sz_ops_filter_passed,qt_exceeds
│ │ │ │ │ │ │ :ref:`tried_regions <sysfs_schemes_tried_regions>`/total_bytes
│ │ │ │ │ │ │ │ 0/start,end,nr_accesses,age,sz_filter_passed
@@ -307,10 +309,10 @@ to ``N-1``. Each directory represents each DAMON-based operation scheme.
schemes/<N>/
------------
-In each scheme directory, seven directories (``access_pattern``, ``quotas``,
-``watermarks``, ``core_filters``, ``ops_filters``, ``filters``, ``stats``, and
-``tried_regions``) and three files (``action``, ``target_nid`` and
-``apply_interval``) exist.
+In each scheme directory, eight directories (``access_pattern``, ``quotas``,
+``watermarks``, ``core_filters``, ``ops_filters``, ``filters``, ``dests``,
+``stats``, and ``tried_regions``) and three files (``action``, ``target_nid``
+and ``apply_interval``) exist.
The ``action`` file is for setting and getting the scheme's :ref:`action
<damon_design_damos_action>`. The keywords that can be written to and read
@@ -484,6 +486,29 @@ Refer to the :ref:`DAMOS filters design documentation
of different ``allow`` works, when each of the filters are supported, and
differences on stats.
+.. _damon_sysfs_dests:
+
+schemes/<N>/dests/
+------------------
+
+Directory for specifying the destinations of given DAMON-based operation
+scheme's action. This directory is ignored if the action of the given scheme
+is not supporting multiple destinations. Only ``DAMOS_MIGRATE_{HOT,COLD}``
+actions are supporting multiple destinations.
+
+In the beginning, the directory has only one file, ``nr_dests``. Writing a
+number (``N``) to the file creates the number of child directories named ``0``
+to ``N-1``. Each directory represents each action destination.
+
+Each destination directory contains two files, namely ``id`` and ``weight``.
+Users can write and read the identifier of the destination to ``id`` file.
+For ``DAMOS_MIGRATE_{HOT,COLD}`` actions, the migrate destination node's node
+id should be written to ``id`` file. Users can write and read the weight of
+the destination among the given destinations to the ``weight`` file. The
+weight can be an arbitrary integer. When DAMOS apply the action to each entity
+of the memory region, it will select the destination of the action based on the
+relative weights of the destinations.
+
.. _sysfs_schemes_stats:
schemes/<N>/stats/
--
2.39.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-07-02 5:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-02 5:15 [RFC PATCH v2 0/6] mm/damon: add DAMOS_MIGRATE_{HOT,COLD} destination nodes and weights SeongJae Park
2025-07-02 5:15 ` [RFC PATCH v2 6/6] Docs/admin-guide/mm/damon/usage: document dests directory SeongJae Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).