* [RFC PATCH 00/10] mm/damon: support address space larger than damon-core address space
@ 2025-04-16 4:25 SeongJae Park
2025-04-16 4:25 ` [RFC PATCH 08/10] Docs/mm/damon/design: document 'address unit' parameter SeongJae Park
2025-04-16 4:25 ` [RFC PATCH 09/10] Docs/admin-guide/mm/damon/usage: document addr_unit file SeongJae Park
0 siblings, 2 replies; 3+ messages in thread
From: SeongJae Park @ 2025-04-16 4:25 UTC (permalink / raw)
Cc: SeongJae Park, Andrew Morton, Jonathan Corbet, Ze Zuo, damon,
kernel-team, linux-doc, linux-kernel, linux-mm
DAMON core layer has its own address space that uses 'unsigned long' for
handling addresses. The underlying DAMON operations set implementation
translates the core layer address to the real address space that it is
working for. For example, vaddr and fvaddr translates the core layer
addresses to virtual addresses.
However, all operations set layer simply assumes the core layer address
will be same to those for the given address space. Since the core layer
address uses 'unsigned long', it is ok for virtual addresses. In case
of physical address space, however, there can be some cases where
'unsigned long' cannot handle whole address. For example, 32bit arm
machines with large physical address extension (LPAE) is such a case[1].
Arm with LPAE is the only reported use case, but similar cases could
happen in future.
Add a new core layer parameter called 'addr_unit'. Operations set layer
can translate a core layer address to the real address by multiplying
the parameter value to the core layer address. Support of the parameter
is up to each operations layer implementation, though. For example,
operations set implementations for virtual address space can simply
ignore the parameter. Add the support on paddr, which is the DAMON
operations set implementation for the physical address space, as we have
a clear use case for that.
Patches Sequence
================
The first patch implements the new parameter on DAMON kernel API.
Following five patches (patch 2-6) incrementally add support of the new
parameter on paddr operations set, for monitoring operations and DAMOS
operations for each DAMOS actions.
The seventh patch implements DAMON sysfs ABI for letting users control
the parameter.
Final three patches (patches 8-10) documents the new ABI on design,
usage, and ABI documents, respectively.
[1] https://lore.kernel.org/20250408075553.959388-1-zuoze1@huawei.com
SeongJae Park (10):
mm/damon/core: add damon_ctx->addr_unit
mm/damon/paddr: support addr_unit for access monitoring
mm/damon/paddr: support addr_unit for DAMOS_PAGEOUT
mm/damon/paddr: support addr_unit for DAMOS_LRU_[DE]PRIO
mm/damon/paddr: support addr_unit for MIGRATE_{HOT,COLD}
mm/damon/paddr: support addr_unit for DAMOS_STAT
mm/damon/sysfs: implement addr_unit file under context dir
Docs/mm/damon/design: document 'address unit' parameter
Docs/admin-guide/mm/damon/usage: document addr_unit file
Docs/ABI/damon: document addr_unit file
.../ABI/testing/sysfs-kernel-mm-damon | 7 ++
Documentation/admin-guide/mm/damon/usage.rst | 11 ++-
Documentation/mm/damon/design.rst | 16 +++-
include/linux/damon.h | 2 +
mm/damon/core.c | 3 +
mm/damon/paddr.c | 95 ++++++++++++-------
mm/damon/sysfs.c | 26 +++++
7 files changed, 119 insertions(+), 41 deletions(-)
base-commit: b32e0b4ccfbe176a541e7feee0cdaebb957738e7
--
2.39.5
^ permalink raw reply [flat|nested] 3+ messages in thread
* [RFC PATCH 08/10] Docs/mm/damon/design: document 'address unit' parameter
2025-04-16 4:25 [RFC PATCH 00/10] mm/damon: support address space larger than damon-core address space SeongJae Park
@ 2025-04-16 4:25 ` SeongJae Park
2025-04-16 4:25 ` [RFC PATCH 09/10] Docs/admin-guide/mm/damon/usage: document addr_unit file SeongJae Park
1 sibling, 0 replies; 3+ messages in thread
From: SeongJae Park @ 2025-04-16 4:25 UTC (permalink / raw)
Cc: SeongJae Park, Andrew Morton, Jonathan Corbet, Ze Zuo, damon,
kernel-team, linux-doc, linux-kernel, linux-mm
Add 'addr_unit' parameter description on DAMON design document.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
Documentation/mm/damon/design.rst | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst
index aa01d0232adc..696a4d738cb3 100644
--- a/Documentation/mm/damon/design.rst
+++ b/Documentation/mm/damon/design.rst
@@ -69,7 +69,7 @@ processes, NUMA nodes, files, and backing memory devices would be supportable.
Also, if some architectures or devices support special optimized access check
features, those will be easily configurable.
-DAMON currently provides below three operation sets. Below two subsections
+DAMON currently provides below three operation sets. Below three subsections
describe how those work.
- vaddr: Monitor virtual address spaces of specific processes
@@ -137,6 +137,18 @@ the interference is the responsibility of sysadmins. However, it solves the
conflict with the reclaim logic using ``PG_idle`` and ``PG_young`` page flags,
as Idle page tracking does.
+Address Unit
+------------
+
+DAMON core layer uses ``unsinged long`` type for monitoring target address
+ranges. In some cases, the address space for a given operations set could be
+too large to be handled with the type. ARM (32-bit) with large physical
+address extension is an example. For such cases, a per-operations set
+parameter called ``address unit`` is provided. It represents the scale factor
+that need to be multiplied to the core layer's address for calculating real
+address on the given address space. Support of ``address unit`` parameter is
+up to each operations set implementation. ``paddr`` is the only operations set
+implementation that supports the parameter.
.. _damon_core_logic:
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [RFC PATCH 09/10] Docs/admin-guide/mm/damon/usage: document addr_unit file
2025-04-16 4:25 [RFC PATCH 00/10] mm/damon: support address space larger than damon-core address space SeongJae Park
2025-04-16 4:25 ` [RFC PATCH 08/10] Docs/mm/damon/design: document 'address unit' parameter SeongJae Park
@ 2025-04-16 4:25 ` SeongJae Park
1 sibling, 0 replies; 3+ messages in thread
From: SeongJae Park @ 2025-04-16 4:25 UTC (permalink / raw)
Cc: SeongJae Park, Andrew Morton, Jonathan Corbet, Ze Zuo, damon,
kernel-team, linux-doc, linux-kernel, linux-mm
Document addr_unit DAMON sysfs file on DAMON usage document.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
Documentation/admin-guide/mm/damon/usage.rst | 11 +++++++----
Documentation/mm/damon/design.rst | 2 ++
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index ced2013db3df..7638bbaf9939 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -61,7 +61,7 @@ comma (",").
│ :ref:`kdamonds <sysfs_kdamonds>`/nr_kdamonds
│ │ :ref:`0 <sysfs_kdamond>`/state,pid
│ │ │ :ref:`contexts <sysfs_contexts>`/nr_contexts
- │ │ │ │ :ref:`0 <sysfs_context>`/avail_operations,operations
+ │ │ │ │ :ref:`0 <sysfs_context>`/avail_operations,operations,addr_unit
│ │ │ │ │ :ref:`monitoring_attrs <sysfs_monitoring_attrs>`/
│ │ │ │ │ │ intervals/sample_us,aggr_us,update_us
│ │ │ │ │ │ │ intervals_goal/access_bp,aggrs,min_sample_us,max_sample_us
@@ -179,9 +179,9 @@ details). At the moment, only one context per kdamond is supported, so only
contexts/<N>/
-------------
-In each context directory, two files (``avail_operations`` and ``operations``)
-and three directories (``monitoring_attrs``, ``targets``, and ``schemes``)
-exist.
+In each context directory, three files (``avail_operations``, ``operations``
+and ``addr_unit``) and three directories (``monitoring_attrs``, ``targets``,
+and ``schemes``) exist.
DAMON supports multiple types of :ref:`monitoring operations
<damon_design_configurable_operations_set>`, including those for virtual address
@@ -196,6 +196,9 @@ You can set and get what type of monitoring operations DAMON will use for the
context by writing one of the keywords listed in ``avail_operations`` file and
reading from the ``operations`` file.
+``addr_unit`` file is for setting and getting the :ref:`address unit
+<damon_design_addr_unit>` parameter of the operations set.
+
.. _sysfs_monitoring_attrs:
contexts/<N>/monitoring_attrs/
diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst
index 696a4d738cb3..56bfc0abff36 100644
--- a/Documentation/mm/damon/design.rst
+++ b/Documentation/mm/damon/design.rst
@@ -137,6 +137,8 @@ the interference is the responsibility of sysadmins. However, it solves the
conflict with the reclaim logic using ``PG_idle`` and ``PG_young`` page flags,
as Idle page tracking does.
+.. _damon_design_addr_unit:
+
Address Unit
------------
--
2.39.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-16 4:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16 4:25 [RFC PATCH 00/10] mm/damon: support address space larger than damon-core address space SeongJae Park
2025-04-16 4:25 ` [RFC PATCH 08/10] Docs/mm/damon/design: document 'address unit' parameter SeongJae Park
2025-04-16 4:25 ` [RFC PATCH 09/10] Docs/admin-guide/mm/damon/usage: document addr_unit file 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).