* [PATCH 02/16] Docs/mm/damon/design: add 'statistics' section
2025-01-06 19:33 [PATCH 00/16] mm/damon: enable page level properties based monitoring SeongJae Park
@ 2025-01-06 19:33 ` SeongJae Park
2025-01-06 19:33 ` [PATCH 03/16] Docs/admin-guide/mm/damon/usage: link damos stat design doc SeongJae Park
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: SeongJae Park @ 2025-01-06 19:33 UTC (permalink / raw)
To: Andrew Morton
Cc: SeongJae Park, Jonathan Corbet, damon, linux-doc, linux-kernel,
linux-mm
DAMOS stats are important feature for tuning of DAMOS-based access-aware
system operation, and efficient access pattern monitoring. But not well
documented on the design document. Add a section on the document.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
Documentation/mm/damon/design.rst | 38 +++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst
index 5385ea04c2fd..aa2e4694ee14 100644
--- a/Documentation/mm/damon/design.rst
+++ b/Documentation/mm/damon/design.rst
@@ -539,6 +539,44 @@ To know how user-space can set the watermarks via :ref:`DAMON sysfs interface
<sysfs_interface>`, refer to :ref:`filters <sysfs_filters>` part of the
documentation.
+Statistics
+~~~~~~~~~~
+
+The statistics of DAMOS behaviors that designed to help monitoring, tuning and
+debugging of DAMOS.
+
+DAMOS accounts below statistics for each scheme, from the beginning of the
+scheme's execution.
+
+- ``nr_tried``: Total number of regions that the scheme is tried to be applied.
+- ``sz_trtied``: Total size of regions that the scheme is tried to be applied.
+- ``nr_applied``: Total number of regions that the scheme is applied.
+- ``sz_applied``: Total size of regions that the scheme is applied.
+- ``qt_exceeds``: Total number of times the quota of the scheme has exceeded.
+
+"A scheme is tried to be applied to a region" means DAMOS core logic determined
+the region is eligible to apply the scheme's :ref:`action
+<damon_design_damos_action>`. The :ref:`access pattern
+<damon_design_damos_access_pattern>`, :ref:`quotas
+<damon_design_damos_quotas>`, :ref:`watermarks
+<damon_design_damos_watermarks>`, and :ref:`filters
+<damon_design_damos_filters>` that handled on core logic could affect this.
+The core logic will only ask the underlying :ref:`operation set
+<damon_operations_set>` to do apply the action to the region, so whether the
+action is really applied or not is unclear. That's why it is called "tried".
+
+"A scheme is applied to a region" means the :ref:`operation set
+<damon_operations_set>` has applied the action to at least a part of the
+region. The :ref:`filters <damon_design_damos_filters>` that handled by the
+operation set, and the types of the :ref:`action <damon_design_damos_action>`
+and the pages of the region can affect this. For example, if a filter is set
+to exclude anonymous pages and the region has only anonymous pages, or if the
+action is ``pageout`` while all pages of the region are unreclaimable, applying
+the action to the region will fail.
+
+To know how user-space can read the stats via :ref:`DAMON sysfs interface
+<sysfs_interface>`, refer to :ref:s`stats <sysfs_stats>` part of the
+documentation.
Regions Walking
~~~~~~~~~~~~~~~
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 03/16] Docs/admin-guide/mm/damon/usage: link damos stat design doc
2025-01-06 19:33 [PATCH 00/16] mm/damon: enable page level properties based monitoring SeongJae Park
2025-01-06 19:33 ` [PATCH 02/16] Docs/mm/damon/design: add 'statistics' section SeongJae Park
@ 2025-01-06 19:33 ` SeongJae Park
2025-01-06 19:33 ` [PATCH 09/16] Docs/mm/damon/design: document sz_ops_filter_passed SeongJae Park
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: SeongJae Park @ 2025-01-06 19:33 UTC (permalink / raw)
To: Andrew Morton
Cc: SeongJae Park, Jonathan Corbet, damon, linux-doc, linux-kernel,
linux-mm
DAMON sysfs usage document focuses on usage, rather than the detail of
the stat metric itself. Add a link to the design document on DAMOS stat
usage section.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
Documentation/admin-guide/mm/damon/usage.rst | 3 ++-
Documentation/mm/damon/design.rst | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index c685d87ea078..2e835c9bcfdf 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -451,7 +451,8 @@ schemes/<N>/stats/
DAMON counts the total number and bytes of regions that each scheme is tried to
be applied, the two numbers for the regions that each scheme is successfully
applied, and the total number of the quota limit exceeds. This statistics can
-be used for online analysis or tuning of the schemes.
+be used for online analysis or tuning of the schemes. Refer to :ref:`design
+doc <damon_design_damos_stat>` for more details about the stats.
The statistics can be retrieved by reading the files under ``stats`` directory
(``nr_tried``, ``sz_tried``, ``nr_applied``, ``sz_applied``, and
diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst
index aa2e4694ee14..158d0a4e1d7f 100644
--- a/Documentation/mm/damon/design.rst
+++ b/Documentation/mm/damon/design.rst
@@ -539,6 +539,8 @@ To know how user-space can set the watermarks via :ref:`DAMON sysfs interface
<sysfs_interface>`, refer to :ref:`filters <sysfs_filters>` part of the
documentation.
+.. _damon_design_damos_stat:
+
Statistics
~~~~~~~~~~
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 09/16] Docs/mm/damon/design: document sz_ops_filter_passed
2025-01-06 19:33 [PATCH 00/16] mm/damon: enable page level properties based monitoring SeongJae Park
2025-01-06 19:33 ` [PATCH 02/16] Docs/mm/damon/design: add 'statistics' section SeongJae Park
2025-01-06 19:33 ` [PATCH 03/16] Docs/admin-guide/mm/damon/usage: link damos stat design doc SeongJae Park
@ 2025-01-06 19:33 ` SeongJae Park
2025-01-06 19:33 ` [PATCH 10/16] Docs/admin-guide/mm/damon/usage: " SeongJae Park
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: SeongJae Park @ 2025-01-06 19:33 UTC (permalink / raw)
To: Andrew Morton
Cc: SeongJae Park, Jonathan Corbet, damon, linux-doc, linux-kernel,
linux-mm
Document the new per-scheme accumulated stat for total bytes that passed
the operations set layer-handled DAMOS filters on the design document.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
Documentation/mm/damon/design.rst | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst
index 158d0a4e1d7f..68145972cb20 100644
--- a/Documentation/mm/damon/design.rst
+++ b/Documentation/mm/damon/design.rst
@@ -552,6 +552,8 @@ scheme's execution.
- ``nr_tried``: Total number of regions that the scheme is tried to be applied.
- ``sz_trtied``: Total size of regions that the scheme is tried to be applied.
+- ``sz_ops_filter_passed``: Total bytes that passed operations set
+ layer-handled DAMOS filters.
- ``nr_applied``: Total number of regions that the scheme is applied.
- ``sz_applied``: Total size of regions that the scheme is applied.
- ``qt_exceeds``: Total number of times the quota of the scheme has exceeded.
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 10/16] Docs/admin-guide/mm/damon/usage: document sz_ops_filter_passed
2025-01-06 19:33 [PATCH 00/16] mm/damon: enable page level properties based monitoring SeongJae Park
` (2 preceding siblings ...)
2025-01-06 19:33 ` [PATCH 09/16] Docs/mm/damon/design: document sz_ops_filter_passed SeongJae Park
@ 2025-01-06 19:33 ` SeongJae Park
2025-01-06 19:33 ` [PATCH 14/16] Docs/mm/damon/design: document per-region sz_filter_passed stat SeongJae Park
2025-01-06 19:34 ` [PATCH 15/16] Docs/admin-guide/mm/damon/usage: document sz_filtered_out of scheme tried region directories SeongJae Park
5 siblings, 0 replies; 7+ messages in thread
From: SeongJae Park @ 2025-01-06 19:33 UTC (permalink / raw)
To: Andrew Morton
Cc: SeongJae Park, Jonathan Corbet, damon, linux-doc, linux-kernel,
linux-mm
Document the new per-scheme operations set layer-handled DAMOS filters
passed bytes statistic file on DAMON sysfs interface usage document.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
Documentation/admin-guide/mm/damon/usage.rst | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index 2e835c9bcfdf..95c174be9c06 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -84,7 +84,7 @@ comma (",").
│ │ │ │ │ │ │ :ref:`watermarks <sysfs_watermarks>`/metric,interval_us,high,mid,low
│ │ │ │ │ │ │ :ref:`filters <sysfs_filters>`/nr_filters
│ │ │ │ │ │ │ │ 0/type,matching,memcg_id
- │ │ │ │ │ │ │ :ref:`stats <sysfs_schemes_stats>`/nr_tried,sz_tried,nr_applied,sz_applied,qt_exceeds
+ │ │ │ │ │ │ │ :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
│ │ │ │ │ │ │ │ ...
@@ -448,18 +448,16 @@ difference is applied to :ref:`stats <damos_stats>` and
schemes/<N>/stats/
------------------
-DAMON counts the total number and bytes of regions that each scheme is tried to
-be applied, the two numbers for the regions that each scheme is successfully
-applied, and the total number of the quota limit exceeds. This statistics can
-be used for online analysis or tuning of the schemes. Refer to :ref:`design
-doc <damon_design_damos_stat>` for more details about the stats.
+DAMON counts statistics for each scheme. This statistics can be used for
+online analysis or tuning of the schemes. Refer to :ref:`design doc
+<damon_design_damos_stat>` for more details about the stats.
The statistics can be retrieved by reading the files under ``stats`` directory
-(``nr_tried``, ``sz_tried``, ``nr_applied``, ``sz_applied``, and
-``qt_exceeds``), respectively. The files are not updated in real time, so you
-should ask DAMON sysfs interface to update the content of the files for the
-stats by writing a special keyword, ``update_schemes_stats`` to the relevant
-``kdamonds/<N>/state`` file.
+(``nr_tried``, ``sz_tried``, ``nr_applied``, ``sz_applied``,
+``sz_ops_filter_passed``, and ``qt_exceeds``), respectively. The files are not
+updated in real time, so you should ask DAMON sysfs interface to update the
+content of the files for the stats by writing a special keyword,
+``update_schemes_stats`` to the relevant ``kdamonds/<N>/state`` file.
.. _sysfs_schemes_tried_regions:
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 14/16] Docs/mm/damon/design: document per-region sz_filter_passed stat
2025-01-06 19:33 [PATCH 00/16] mm/damon: enable page level properties based monitoring SeongJae Park
` (3 preceding siblings ...)
2025-01-06 19:33 ` [PATCH 10/16] Docs/admin-guide/mm/damon/usage: " SeongJae Park
@ 2025-01-06 19:33 ` SeongJae Park
2025-01-06 19:34 ` [PATCH 15/16] Docs/admin-guide/mm/damon/usage: document sz_filtered_out of scheme tried region directories SeongJae Park
5 siblings, 0 replies; 7+ messages in thread
From: SeongJae Park @ 2025-01-06 19:33 UTC (permalink / raw)
To: Andrew Morton
Cc: SeongJae Park, Jonathan Corbet, damon, linux-doc, linux-kernel,
linux-mm
Update 'Regions Walking' sectioin of design document for the newly added
per-region operations set handling DAMOS filters-passed bytes.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
Documentation/mm/damon/design.rst | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst
index 68145972cb20..449eb33688c2 100644
--- a/Documentation/mm/damon/design.rst
+++ b/Documentation/mm/damon/design.rst
@@ -587,7 +587,8 @@ Regions Walking
DAMOS feature allowing users access each region that a DAMOS action has just
applied. Using this feature, DAMON :ref:`API <damon_design_api>` allows users
-access full properties of the regions including the access monitoring results.
+access full properties of the regions including the access monitoring results
+and amount of the region's internal memory that passed the DAMOS filters.
:ref:`DAMON sysfs interface <sysfs_interface>` also allows users read the data
via special :ref:`files <sysfs_schemes_tried_regions>`.
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 15/16] Docs/admin-guide/mm/damon/usage: document sz_filtered_out of scheme tried region directories
2025-01-06 19:33 [PATCH 00/16] mm/damon: enable page level properties based monitoring SeongJae Park
` (4 preceding siblings ...)
2025-01-06 19:33 ` [PATCH 14/16] Docs/mm/damon/design: document per-region sz_filter_passed stat SeongJae Park
@ 2025-01-06 19:34 ` SeongJae Park
5 siblings, 0 replies; 7+ messages in thread
From: SeongJae Park @ 2025-01-06 19:34 UTC (permalink / raw)
To: Andrew Morton
Cc: SeongJae Park, Jonathan Corbet, damon, linux-doc, linux-kernel,
linux-mm
Document the newly added DAMON sysfs interface file for per-scheme-tried
region's bytes that passed the operations set handling DAMOS filters.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
Documentation/admin-guide/mm/damon/usage.rst | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index 95c174be9c06..71cf29ae8502 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -86,7 +86,7 @@ comma (",").
│ │ │ │ │ │ │ │ 0/type,matching,memcg_id
│ │ │ │ │ │ │ :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
+ │ │ │ │ │ │ │ │ 0/start,end,nr_accesses,age,sz_filter_passed
│ │ │ │ │ │ │ │ ...
│ │ │ │ │ │ ...
│ │ │ │ ...
@@ -494,10 +494,10 @@ set the ``access pattern`` as their interested pattern that they want to query.
tried_regions/<N>/
------------------
-In each region directory, you will find four files (``start``, ``end``,
-``nr_accesses``, and ``age``). Reading the files will show the start and end
-addresses, ``nr_accesses``, and ``age`` of the region that corresponding
-DAMON-based operation scheme ``action`` has tried to be applied.
+In each region directory, you will find five files (``start``, ``end``,
+``nr_accesses``, ``age``, and ``sz_filter_passed``). Reading the files will
+show the properties of the region that corresponding DAMON-based operation
+scheme ``action`` has tried to be applied.
Example
~~~~~~~
--
2.39.5
^ permalink raw reply related [flat|nested] 7+ messages in thread