[RFC v5 05/11] Docs/damon: Document 'initial_regions' feature

From: SeongJae Park
Date: Tue Jul 07 2020 - 10:48:57 EST


From: SeongJae Park <sjpark@xxxxxxxxx>

This commit documents the 'initial_regions' feature.

Signed-off-by: SeongJae Park <sjpark@xxxxxxxxx>
---
Documentation/admin-guide/mm/damon/usage.rst | 35 ++++++++++++++++++++
1 file changed, 35 insertions(+)

diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index 153f07da9368..573fcb4c57a7 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -315,6 +315,41 @@ having pids 42 and 4242 as the processes to be monitored and check it again::
Note that setting the pids doesn't start the monitoring.


+Initial Monitoring Target Regions
+---------------------------------
+
+In case of the debugfs based monitoring, DAMON automatically sets and updates
+the monitoring target regions so that entire memory mappings of target
+processes can be covered. However, users might want to limit the monitoring
+region to specific address ranges, such as the heap, the stack, or specific
+file-mapped area. Or, some users might know the initial access pattern of their
+workloads and therefore want to set optimal initial regions for the 'adaptive
+regions adjustment'.
+
+In such cases, users can explicitly set the initial monitoring target regions
+as they want, by writing proper values to the ``init_regions`` file. Each line
+of the input should represent one region in below form.::
+
+ <pid> <start address> <end address>
+
+The ``pid`` should already in ``pids`` file, and the regions should be
+passed in address order. For example, below commands will set a couple of
+address ranges, ``1-100`` and ``100-200`` as the initial monitoring target
+region of process 42, and another couple of address ranges, ``20-40`` and
+``50-100`` as that of process 4242.::
+
+ # cd <debugfs>/damon
+ # echo "42 1 100
+ 42 100 200
+ 4242 20 40
+ 4242 50 100" > init_regions
+
+Note that this sets the initial monitoring target regions only. DAMON will
+automatically updates the boundary of the regions after one ``regions update
+interval``. Therefore, users should set the ``regions update interval`` large
+enough.
+
+
Record
------

--
2.17.1