Linux Documentation
 help / color / mirror / Atom feed
* [PATCH 0/9] mm/damon: various fixes and cleanup of code, test, and docs
@ 2026-11-02 15:07 SJ Park
  2026-11-02 15:07 ` [PATCH 8/9] Docs/admin-guide/mm/damon/lru_sort: fix grammar and stlye SJ Park
  2026-11-02 15:07 ` [PATCH 9/9] Docs/admin-guide/mm/damon/reclaim: document how to disable watermarks SJ Park
  0 siblings, 2 replies; 3+ messages in thread
From: SJ Park @ 2026-11-02 15:07 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SJ Park, Adrian Huang (Lenovo), Bijan Tabatabai, Fernand Sieber,
	Jonathan Corbet, Leonard Foerster, Randy Dunlap, SeongJae Park,
	Shakeel Butt, Shuah Khan, Shuah Khan, Shubhang Kaushik, damon,
	linux-doc, linux-kernel, linux-kselftest, linux-mm

Fix and cleanup various parts of DAMON including its code, test, and
documentation.

Optimize the efficiency and monitoring accuracy of DAMON code with the
first five patches.  Remove unnecessary initializations in
damon_new_ctx() with patch 1 from Adrian Huang (Lenovo).  Align MMU
notifier ranges when clearing PTE/PMD young bits with patches 2 and 3
from Shubhang Kaushik (Ampere) and Aveline Noir.  Avoid DAMON_STAT idle
time percentile overflow on 32-bit architectures, and optimize out
unnecessary folio LRU isolation from DAMOS_MIGRATE action, with
patches 4 and 5 from Aveline Noir, respectively.

Fix and cleanup tests and documents with remaining four patches.  Let
sysfs.py test does not hang when it is executed under interactive
terminal with patch 6 from Jaeyeong Lee.  Fix typos, grammatical errors
and styles in DAMON_RECLAIM comments and DAMON_LRU_SORT user documents
with patches 7 and 8 from Manuel.  Finally, document how to disable
watermarks of DAMON_RECLAIM with patch 9 from Jinjie Ruan.

Reviewer notes.  This is a collection of DAMON patches that are posted
by individual contributors and resposted as an mm.git merge request.
Each patch has its own changelog.

Adrian Huang (Lenovo) (1):
  mm/damon/core: remove unnecessary zero-initialization in
    damon_new_ctx()

Aveline Noir (3):
  mm/damon/ops-common: align MMU notifier range when clearing PMD young
    bit
  mm/damon/stat: avoid 32-bit overflow in idle percentiles
  mm/damon/{p,v}addr: skip folios already on the migration target node

Jaeyeon Lee (1):
  selftests/damon/sysfs.py: stop obsolete_target shells hanging the test

Jinjie Ruan (1):
  Docs/admin-guide/mm/damon/reclaim: document how to disable watermarks

Manuel Ebner (2):
  mm/damon/reclaim: fix typo and grammar
  Docs/admin-guide/mm/damon/lru_sort: fix grammar and stlye

Shubhang Kaushik (Ampere) (1):
  mm/damon/ops-common: align MMU notifier range when clearing PTE young
    bit

 .../admin-guide/mm/damon/lru_sort.rst         | 61 +++++++++----------
 .../admin-guide/mm/damon/reclaim.rst          |  4 ++
 mm/damon/core.c                               |  5 --
 mm/damon/ops-common.c                         |  7 ++-
 mm/damon/paddr.c                              |  2 +
 mm/damon/reclaim.c                            | 14 ++---
 mm/damon/stat.c                               |  5 +-
 mm/damon/vaddr.c                              | 18 +++---
 tools/testing/selftests/damon/sysfs.py        | 12 ++--
 9 files changed, 67 insertions(+), 61 deletions(-)


base-commit: 18e5bc25101d458c94de6ccb0f7df5d8ec000fb7
-- 
2.47.3

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

* [PATCH 8/9] Docs/admin-guide/mm/damon/lru_sort: fix grammar and stlye
  2026-11-02 15:07 [PATCH 0/9] mm/damon: various fixes and cleanup of code, test, and docs SJ Park
@ 2026-11-02 15:07 ` SJ Park
  2026-11-02 15:07 ` [PATCH 9/9] Docs/admin-guide/mm/damon/reclaim: document how to disable watermarks SJ Park
  1 sibling, 0 replies; 3+ messages in thread
From: SJ Park @ 2026-11-02 15:07 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Manuel Ebner, Jonathan Corbet, Randy Dunlap, SJ Park, Shuah Khan,
	damon, linux-doc, linux-kernel, linux-mm

From: Manuel Ebner <manuelebnerli@mailbox.org>

Fix tenses. Split long sentences thereby imporove readability.  Replace
'set as' with 'set to'. Replace [] with () to make the file uniform.

Signed-off-by: Manuel Ebner <manuelebnerli@mailbox.org>
Reviewed-by: SJ Park <sj@kernel.org>
Signed-off-by: SJ Park <sj@kernel.org>
---
Changes from v3
- v3: https://lore.kernel.org/20261017083535.1261388-2-manuelebnerli@mailbox.org
- Rebase to latest mm-new.

[v3]
 Split long line
 Fix path in subject / One-line summary

[v2]
 https://lore.kernel.org/20261015072947.802821-2-manuelebnerli@mailbox.org
 Collect R-b: from SJ.

[v1]
 https://lore.kernel.org/20261013191327.663331-2-manuelebnerli@mailbox.org
 Wordsmith commit message.
 Fixup a few trivial wording.

 .../admin-guide/mm/damon/lru_sort.rst         | 61 +++++++++----------
 1 file changed, 30 insertions(+), 31 deletions(-)

diff --git a/Documentation/admin-guide/mm/damon/lru_sort.rst b/Documentation/admin-guide/mm/damon/lru_sort.rst
index b93ca9b0853d2..f1eeb6389c377 100644
--- a/Documentation/admin-guide/mm/damon/lru_sort.rst
+++ b/Documentation/admin-guide/mm/damon/lru_sort.rst
@@ -5,20 +5,19 @@ DAMON-based LRU-lists Sorting
 =============================
 
 DAMON-based LRU-lists Sorting (DAMON_LRU_SORT) is a static kernel module that
-aimed to be used for proactive and lightweight data access pattern based
+aims to be used for proactive and lightweight data access pattern based
 (de)prioritization of pages on their LRU-lists for making LRU-lists a more
 trusworthy data access pattern source.
 
 Where Proactive LRU-lists Sorting is Required?
 ==============================================
 
-As page-granularity access checking overhead could be significant on huge
-systems, LRU lists are normally not proactively sorted but partially and
-reactively sorted for special events including specific user requests, system
-calls and memory pressure.  As a result, LRU lists are sometimes not so
-perfectly prepared to be used as a trustworthy access pattern source for some
-situations including reclamation target pages selection under sudden memory
-pressure.
+As page-granularity access checking overhead could be significant on huge systems,
+LRU lists are normally not fully nor proactively sorted but rather partially
+and reactively sorted for special events.  These events include specific user requests,
+system calls and memory pressure.  As a result, LRU lists are sometimes not
+suitable to be used as a trustworthy access pattern source.  These situations
+including reclamation target page selection under sudden memory pressure.
 
 Because DAMON can identify access patterns of best-effort accuracy while
 inducing only user-specified range of overhead, proactively running
@@ -28,9 +27,9 @@ pattern source with low and controlled overhead.
 How It Works?
 =============
 
-DAMON_LRU_SORT finds hot pages (pages of memory regions that showing access
-rates that higher than a user-specified threshold) and cold pages (pages of
-memory regions that showing no access for a time that longer than a
+DAMON_LRU_SORT finds hot pages (pages of memory regions that show access
+rates that are higher than a user-specified threshold) and cold pages (pages of
+memory regions that show no access for a duration that is longer than a
 user-specified threshold) using DAMON, and prioritizes hot pages while
 deprioritizing cold pages on their LRU-lists.  To avoid it consuming too much
 CPU for the prioritizations, a CPU time usage limit can be configured.  Under
@@ -63,10 +62,10 @@ enabled
 
 Enable or disable DAMON_LRU_SORT.
 
-You can enable DAMON_LRU_SORT by setting the value of this parameter as ``Y``.
-Setting it as ``N`` disables DAMON_LRU_SORT.  Note that DAMON_LRU_SORT could do
+You can enable DAMON_LRU_SORT by setting the value of this parameter to ``Y``.
+Setting it to ``N`` disables DAMON_LRU_SORT.  Note that DAMON_LRU_SORT could do
 no real monitoring and LRU-lists sorting due to the watermarks-based activation
-condition.  Refer to below descriptions for the watermarks parameter for this.
+condition.  Refer to below descriptions of the watermarks parameter for this.
 
 commit_inputs
 -------------
@@ -74,9 +73,9 @@ commit_inputs
 Make DAMON_LRU_SORT reads the input parameters again, except ``enabled``.
 
 Input parameters that updated while DAMON_LRU_SORT is running are not applied
-by default.  Once this parameter is set as ``Y``, DAMON_LRU_SORT reads values
+by default.  Once this parameter is set to ``Y``, DAMON_LRU_SORT reads values
 of parameters except ``enabled`` again.  Once the re-reading is done, this
-parameter is set as ``N``.  If invalid parameters are found while the
+parameter is set to ``N``.  If invalid parameters are found while the
 re-reading, DAMON_LRU_SORT will be disabled.
 
 Once ``Y`` is written to this parameter, the user must not write to any
@@ -86,37 +85,37 @@ violate this rule, the kernel may exhibit undefined behavior.
 active_mem_bp
 -------------
 
-Desired active to [in]active memory ratio in bp (1/10,000).
+Desired active to (in)active memory ratio in bp (1/10,000).
 
 While keeping the caps that set by other quotas, DAMON_LRU_SORT automatically
 increases and decreases the effective level of the quota aiming the LRU
-[de]prioritizations of the hot and cold memory resulting in this active to
-[in]active memory ratio.  Value zero means disabling this auto-tuning feature.
+(de)prioritizations of the hot and cold memory resulting in this active to
+(in)active memory ratio.  Value zero means disabling this auto-tuning feature.
 
 Disabled by default.
 
 autotune_monitoring_intervals
 -----------------------------
 
-If this parameter is set as ``Y``, DAMON_LRU_SORT automatically tunes DAMON's
+If this parameter is set to ``Y``, DAMON_LRU_SORT automatically tunes DAMON's
 sampling and aggregation intervals.  The auto-tuning aims to capture meaningful
 amount of access events in each DAMON-snapshot, while keeping the sampling
-interval 5 milliseconds in minimum, and 10 seconds in maximum.  Setting this as
-``N`` disables the auto-tuning.
+interval to 5 milliseconds in minimum, and to 10 seconds in maximum.  Setting this
+to ``N`` disables the auto-tuning.
 
 Disabled by default.
 
 filter_young_pages
 ------------------
 
-Filter [non-]young pages accordingly for LRU [de]prioritizations.
+Filter (non-)young pages accordingly for LRU (de)prioritizations.
 
 If this is set, check page level access (youngness) once again before each
-LRU [de]prioritization operation.  LRU prioritization operation is skipped
+LRU (de)prioritization operation.  LRU prioritization operation is skipped
 if the page has not accessed since the last check (not young).  LRU
 deprioritization operation is skipped if the page has accessed since the
 last check (young).  The feature is enabled or disabled if this parameter is
-set as ``Y`` or ``N``, respectively.
+set to ``Y`` or ``N``, respectively.
 
 Disabled by default.
 
@@ -235,7 +234,7 @@ max_nr_regions
 Maximum number of monitoring regions.
 
 The maximum number of monitoring regions of DAMON for the cold memory
-monitoring.  This can be used to set upper-bound of the monitoring overhead.
+monitoring.  This can be used to set the upper-bound of the monitoring overhead.
 However, setting this too low could result in bad monitoring quality.  Please
 refer to the DAMON documentation (:doc:`usage`) for more detail.  1000 by
 defaults.
@@ -268,7 +267,7 @@ This parameter is for setting and getting the :ref:`address unit
 
 ``monitor_region_start`` and ``monitor_region_end`` should be provided in this
 unit.  For example, let's suppose ``addr_unit``, ``monitor_region_start`` and
-``monitor_region_end`` are set as ``1024``, ``0`` and ``10``, respectively.
+``monitor_region_end`` are set to ``1024``, ``0`` and ``10``, respectively.
 Then DAMON_LRU_SORT will work for 10 KiB length of physical address range that
 starts from address zero (``[0 * 1024, 10 * 1024)`` in bytes).
 
@@ -291,22 +290,22 @@ If DAMON_LRU_SORT is enabled, this becomes the PID of the worker thread.  Else,
 nr_lru_sort_tried_hot_regions
 -----------------------------
 
-Number of hot memory regions that tried to be LRU-sorted.
+Number of hot memory regions that were tried to be LRU-sorted.
 
 bytes_lru_sort_tried_hot_regions
 --------------------------------
 
-Total bytes of hot memory regions that tried to be LRU-sorted.
+Total bytes of hot memory regions that were tried to be LRU-sorted.
 
 nr_lru_sorted_hot_regions
 -------------------------
 
-Number of hot memory regions that successfully be LRU-sorted.
+Number of hot memory regions that were successfully LRU-sorted.
 
 bytes_lru_sorted_hot_regions
 ----------------------------
 
-Total bytes of hot memory regions that successfully be LRU-sorted.
+Total bytes of hot memory regions that were successfully LRU-sorted.
 
 nr_hot_quota_exceeds
 --------------------
-- 
2.47.3

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

* [PATCH 9/9] Docs/admin-guide/mm/damon/reclaim: document how to disable watermarks
  2026-11-02 15:07 [PATCH 0/9] mm/damon: various fixes and cleanup of code, test, and docs SJ Park
  2026-11-02 15:07 ` [PATCH 8/9] Docs/admin-guide/mm/damon/lru_sort: fix grammar and stlye SJ Park
@ 2026-11-02 15:07 ` SJ Park
  1 sibling, 0 replies; 3+ messages in thread
From: SJ Park @ 2026-11-02 15:07 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Jinjie Ruan, Jonathan Corbet, Randy Dunlap, SJ Park, Shuah Khan,
	damon, linux-doc, linux-kernel, linux-mm

From: Jinjie Ruan <ruanjinjie@huawei.com>

DAMON_RECLAIM runs its scheme only while the free memory rate is
between `wmarks_low` and `wmarks_mid`.

But some users want to reclaim cold pages even while the system has
plenty of free memory, and it is not obvious that the existing
watermarks parameters can already do that. So Document the setup.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: SJ Park <sj@kernel.org>
Signed-off-by: SJ Park <sj@kernel.org>
---
Changes from v1
- v1: https://lore.kernel.org/20261028023628.795637-1-ruanjinjie@huawei.com
- Collect R-b: from SJ.
- Rebase to latest mm-new.

 Documentation/admin-guide/mm/damon/reclaim.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/admin-guide/mm/damon/reclaim.rst b/Documentation/admin-guide/mm/damon/reclaim.rst
index ec7e3e32b4ac6..14f9b82b38ed9 100644
--- a/Documentation/admin-guide/mm/damon/reclaim.rst
+++ b/Documentation/admin-guide/mm/damon/reclaim.rst
@@ -193,6 +193,10 @@ DAMON_RECLAIM becomes inactive, so it does nothing but periodically checks the
 watermarks.  In the case, the system falls back to the LRU-list based page
 granularity reclamation logic.
 
+To keep DAMON_RECLAIM always active regardless of the free memory rate, set
+``wmarks_high``, ``wmarks_mid`` and ``wmarks_low`` to ``1000``, ``1000`` and
+``0``, respectively.
+
 sample_interval
 ---------------
 
-- 
2.47.3

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

end of thread, other threads:[~2026-11-02 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02 15:07 [PATCH 0/9] mm/damon: various fixes and cleanup of code, test, and docs SJ Park
2026-11-02 15:07 ` [PATCH 8/9] Docs/admin-guide/mm/damon/lru_sort: fix grammar and stlye SJ Park
2026-11-02 15:07 ` [PATCH 9/9] Docs/admin-guide/mm/damon/reclaim: document how to disable watermarks SJ Park

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox