linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Docs/admin-buide/mm/damon/usage: minor fixes
@ 2022-10-24 17:46 SeongJae Park
  2022-10-24 17:46 ` [PATCH 1/2] Docs/admin-guide/mm/damon/usage: describe the rules of sysfs region directories SeongJae Park
  2022-10-24 17:46 ` [PATCH 2/2] Docs/admin-guide/mm/damon/usage: Fix wrong usage example of init_regions file SeongJae Park
  0 siblings, 2 replies; 3+ messages in thread
From: SeongJae Park @ 2022-10-24 17:46 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, Jonathan Corbet, damon, linux-doc, linux-kernel,
	linux-mm

DAMON usage document contains an unclear description and a wrong usage
example.  This patchset fixes the two minor problems.

SeongJae Park (2):
  Docs/admin-guide/mm/damon/usage: describe the rules of sysfs region
    directories
  Docs/admin-guide/mm/damon/usage: Fix wrong usage example of
    init_regions file

 Documentation/admin-guide/mm/damon/usage.rst | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

-- 
2.25.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] Docs/admin-guide/mm/damon/usage: describe the rules of sysfs region directories
  2022-10-24 17:46 [PATCH 0/2] Docs/admin-buide/mm/damon/usage: minor fixes SeongJae Park
@ 2022-10-24 17:46 ` SeongJae Park
  2022-10-24 17:46 ` [PATCH 2/2] Docs/admin-guide/mm/damon/usage: Fix wrong usage example of init_regions file SeongJae Park
  1 sibling, 0 replies; 3+ messages in thread
From: SeongJae Park @ 2022-10-24 17:46 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, Jonathan Corbet, damon, linux-mm, linux-doc,
	linux-kernel, Vinicius Petrucci

Target region directories of DAMON sysfs interface should contain no
overlap and sorted by the address, but not clearly documented.
Actually, a user had an issue[1] due to the poor documentation.  Add
clear description of it on the usage document.

[1] https://lore.kernel.org/damon/CAEZ6=UNUcH2BvJj++OrT=XQLdkidU79wmCO=tantSOB36pPNTg@mail.gmail.com/

Reported-by: Vinicius Petrucci <vpetrucci@gmail.com>
Signed-off-by: SeongJae Park <sj@kernel.org>
---
 Documentation/admin-guide/mm/damon/usage.rst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index b47b0cbbd491..89d9a4f75a29 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -235,6 +235,9 @@ In each region directory, you will find two files (``start`` and ``end``).  You
 can set and get the start and end addresses of the initial monitoring target
 region by writing to and reading from the files, respectively.
 
+Each region should not overlap with others.  ``end`` of directory ``N`` should
+be equal or smaller than ``start`` of directory ``N+1``.
+
 contexts/<N>/schemes/
 ---------------------
 
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] Docs/admin-guide/mm/damon/usage: Fix wrong usage example of init_regions file
  2022-10-24 17:46 [PATCH 0/2] Docs/admin-buide/mm/damon/usage: minor fixes SeongJae Park
  2022-10-24 17:46 ` [PATCH 1/2] Docs/admin-guide/mm/damon/usage: describe the rules of sysfs region directories SeongJae Park
@ 2022-10-24 17:46 ` SeongJae Park
  1 sibling, 0 replies; 3+ messages in thread
From: SeongJae Park @ 2022-10-24 17:46 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Jonathan Corbet, damon, linux-mm, linux-doc, linux-kernel,
	SeongJae Park

DAMON debugfs interface assumes the users will write all inputs at once.
However, redirecting a string of multiple lines sometimes end up writing
line by line.  Therefore, the example usage of 'init_regions' file,
which writes input as a string of multiple lines can fail.  Fix it to
use a single line string instead.  Also update the description of the
usage to not assume users will write inputs in multiple lines.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 Documentation/admin-guide/mm/damon/usage.rst | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index 89d9a4f75a29..c17e02e1e426 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -468,8 +468,9 @@ regions in case of physical memory monitoring.  Therefore, users should set the
 monitoring target regions by themselves.
 
 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.::
+as they want, by writing proper values to the ``init_regions`` file.  The input
+should be a sequence of three integers separated by white spaces that represent
+one region in below form.::
 
     <target idx> <start address> <end address>
 
@@ -484,9 +485,9 @@ ranges, ``20-40`` and ``50-100`` as that of pid 4242, which is the second one
     # cd <debugfs>/damon
     # cat target_ids
     42 4242
-    # echo "0   1       100
-            0   100     200
-            1   20      40
+    # echo "0   1       100 \
+            0   100     200 \
+            1   20      40  \
             1   50      100" > init_regions
 
 Note that this sets the initial monitoring target regions only.  In case of
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-24 17:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-24 17:46 [PATCH 0/2] Docs/admin-buide/mm/damon/usage: minor fixes SeongJae Park
2022-10-24 17:46 ` [PATCH 1/2] Docs/admin-guide/mm/damon/usage: describe the rules of sysfs region directories SeongJae Park
2022-10-24 17:46 ` [PATCH 2/2] Docs/admin-guide/mm/damon/usage: Fix wrong usage example of init_regions 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).