public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] mm/damon: advance DAMOS-based LRU sorting
@ 2026-01-13 15:27 SeongJae Park
  2026-01-13 15:27 ` [PATCH 03/11] Docs/mm/damon/design: document DAMOS_QUOTA_[IN]ACTIVE_MEM_BP SeongJae Park
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: SeongJae Park @ 2026-01-13 15:27 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, Liam R. Howlett, David Hildenbrand,
	Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
	Suren Baghdasaryan, Vlastimil Babka, damon, linux-doc,
	linux-kernel, linux-mm

DAMOS_LRU_[DE]PRIO actions were added to DAMOS for more access-aware LRU
lists sorting.  For simple usage, a specialized kernel module, namely
DAMON_LRU_SORT, has also been introduced.  After the introduction of the
module, DAMON got a few important new features, including the aim-based
quota auto-tuning, age tracking, young page filter, and monitoring
intervals auto-tuning.  Meanwhile, DAMOS-based LRU sorting had no direct
updates.  Now we show some rooms to advance for DAMOS-based LRU sorting.

Firstly, the aim-oriented quota auto-tuning can simplify the LRU
sorting parameters tuning.  But there is no good auto-tuning target
metric for LRU sorting use case.  Secondly, the behavior of
DAMOS_LRU_[DE]PRIO are not very symmetric.  DAMOS_LRU_DEPRIO directly
moves the pages to inactive LRU list, while DAMOS_LRU_PRIO only marks
the page as accessed, so that the page can not directly but only
eventually moved to the active LRU list.  Finally, DAMON_LRU_SORT users
cannot utilize the modern features that can be useful for them, too.

Improve the situation with the following changes.  First, introduce a
new DAMOS quota auto-tuning target metric for active:inactive memory
size ratio.  Since LRU sorting is a kind of balancing of active and
inactive pages, the active:inactive memory size ratio can be intuitively
set.  Second, update DAMOS_LRU_[DE]PRIO behaviors to be more intuitive
and symmetric, by letting them directly move the pages to [in]active LRU
list.  Third, update the DAMON_LRU_SORT module user interface to be able
to fully utilize the modern features including the [in]active memory
size ratio-based quota auto-tuning, young page filter, and monitoring
intervals auto-tuning.

With these changes, for example, users can now ask DAMON to "find
hot/cold memory regions with auto-tuned monitoring intervals, do one
more page level access check for found hot/cold memory, and move pages
of those to active or inactive LRU lists accordingly, aiming X:Y active
to inactive memory ratio."  For example, if they know 30% of the memory
is better to be protected from reclamation, 30:70 can be set as the
target ratio.

Test Results
------------

I ran DAMON_LRU_SORT with the features introduced by this series, on a
real world server workload.  For the active:inactive ratio goal, I set
50:50.  I confirmed it achieves the target active:inactive ratio,
without manual tuning of the monitoring intervals and the hot/coldness
thresholds.  The baseline system that was not running the DAMON_LRU_SORT
was keeping active:inactive ratio of about 1:10.

Note that the test didn't show a clear performance difference, though.  I
believe that was mainly because the workload was not very memory
intensive.  Also, whether the 50:50 target ratio was optimum is unclear.
Nonetheless, the positive performance impact of the basic LRU sorting
idea is already confirmed with the initial DAMON_LRU_SORT introduction
patch series.  The goal of this patch series is simplifying the
parameters tuning of DAMOS-based LRU sorting, and the test confirmed the
aimed goals are achieved.

Patches Sequence
----------------

First three patches extend DAMOS quota auto-tuning to support [in]active
memory ratio target metric type.  Those (patches 1-3) introduce new
metrics, implement DAMON sysfs support, and update the documentation,
respectively.

Following patch (patch 4) makes DAMOS_LRU_PRIO action to directly move
target pages to active LRU list, instead of only marking them accessed.

Following seven patches (patches 5-11) updates DAMON_LRU_SORT to support
modern DAMON features.  Patch 5 makes it uses not only access
frequency but also age at under-quota regions prioritization.  Patches
6-11 add the support for young page filtering, active:inactive memory
ratio based quota auto-tuning, and monitoring intervals auto-tuning,
with appropriate document updates.

Changes from RFC
(https://lore.kernel.org/20250628165144.55528-1-sj@kernel.org)
- rebase to latest mm-new
- add test results on the cover letter
- minor wordsmithing and typo fixes

SeongJae Park (11):
  mm/damon/core: introduce [in]active memory ratio damos quota goal
    metric
  mm/damon/sysfs-schemes: support DAMOS_QUOTA_[IN]ACTIVE_MEM_BP
  Docs/mm/damon/design: document DAMOS_QUOTA_[IN]ACTIVE_MEM_BP
  mm/damon/paddr: activate DAMOS_LRU_PRIO targets instead of marking
    accessed
  mm/damon/lru_sort: consider age for quota prioritization
  mm/damon/lru_sort: support young page filters
  Docs/admin-guide/mm/damon/lru_sort: document filter_young_pages
  mm/damon/lru_sort: support active:inactive memory ratio based
    auto-tuning
  Docs/admin-guide/mm/damon/lru_sort: document active_mem_bp parameter
  mm/damon/lru_sort: add monitoring intervals auto-tuning parameter
  Docs/admin-guide/mm/damon/lru_sort: document intervals autotuning

 .../admin-guide/mm/damon/lru_sort.rst         |  37 ++++++
 Documentation/mm/damon/design.rst             |   4 +
 include/linux/damon.h                         |   4 +
 mm/damon/core.c                               |  22 ++++
 mm/damon/lru_sort.c                           | 110 +++++++++++++++++-
 mm/damon/paddr.c                              |  18 ++-
 mm/damon/sysfs-schemes.c                      |   8 ++
 7 files changed, 189 insertions(+), 14 deletions(-)


base-commit: 7a1491b1b0a461872951e8fdf885fc243f67f5e4
-- 
2.47.3

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

* [PATCH 03/11] Docs/mm/damon/design: document DAMOS_QUOTA_[IN]ACTIVE_MEM_BP
  2026-01-13 15:27 [PATCH 00/11] mm/damon: advance DAMOS-based LRU sorting SeongJae Park
@ 2026-01-13 15:27 ` SeongJae Park
  2026-01-14  2:51   ` wang lian
  2026-01-13 15:27 ` [PATCH 07/11] Docs/admin-guide/mm/damon/lru_sort: document filter_young_pages SeongJae Park
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: SeongJae Park @ 2026-01-13 15:27 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, Liam R. Howlett, David Hildenbrand,
	Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
	Suren Baghdasaryan, Vlastimil Babka, damon, linux-doc,
	linux-kernel, linux-mm

Update design document for newly added DAMOS_QUOTA_[IN]ACTIVE_MEM_BP
metrics.  Note that API document is automatically updated by kernel-doc
comment, and the usage document points to the design document which uses
keywords same to that for sysfs inputs.  Hence updating only design
document is sufficient.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 Documentation/mm/damon/design.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst
index 7fd819b8bbf7..0cfd4c25e92d 100644
--- a/Documentation/mm/damon/design.rst
+++ b/Documentation/mm/damon/design.rst
@@ -585,6 +585,10 @@ mechanism tries to make ``current_value`` of ``target_metric`` be same to
   specific NUMA node, in bp (1/10,000).
 - ``node_memcg_free_bp``: Specific cgroup's node unused memory ratio for a
   specific NUMA node, in bp (1/10,000).
+- ``active_mem_bp``: Active to active + inactive (LRU) memory size ratio in bp
+  (1/10,000).
+- ``inactive_mem_bp``: Inactive to active + inactive (LRU) memory size ratio in
+  bp (1/10,000).
 
 ``nid`` is optionally required for only ``node_mem_used_bp``,
 ``node_mem_free_bp``, ``node_memcg_used_bp`` and ``node_memcg_free_bp`` to
-- 
2.47.3

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

* [PATCH 07/11] Docs/admin-guide/mm/damon/lru_sort: document filter_young_pages
  2026-01-13 15:27 [PATCH 00/11] mm/damon: advance DAMOS-based LRU sorting SeongJae Park
  2026-01-13 15:27 ` [PATCH 03/11] Docs/mm/damon/design: document DAMOS_QUOTA_[IN]ACTIVE_MEM_BP SeongJae Park
@ 2026-01-13 15:27 ` SeongJae Park
  2026-01-14  3:25   ` wang lian
  2026-01-13 15:27 ` [PATCH 09/11] Docs/admin-guide/mm/damon/lru_sort: document active_mem_bp parameter SeongJae Park
  2026-01-13 15:27 ` [PATCH 11/11] Docs/admin-guide/mm/damon/lru_sort: document intervals autotuning SeongJae Park
  3 siblings, 1 reply; 9+ messages in thread
From: SeongJae Park @ 2026-01-13 15:27 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, Liam R. Howlett, David Hildenbrand,
	Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
	Suren Baghdasaryan, Vlastimil Babka, damon, linux-doc,
	linux-kernel, linux-mm

Document the new DAMON_LRU_SORT parameter, filter_young_pages.  It can
be used to use page level access re-check for the LRU sorting.

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

diff --git a/Documentation/admin-guide/mm/damon/lru_sort.rst b/Documentation/admin-guide/mm/damon/lru_sort.rst
index 72a943202676..bb222a32aefd 100644
--- a/Documentation/admin-guide/mm/damon/lru_sort.rst
+++ b/Documentation/admin-guide/mm/damon/lru_sort.rst
@@ -79,6 +79,20 @@ of parametrs except ``enabled`` again.  Once the re-reading is done, this
 parameter is set as ``N``.  If invalid parameters are found while the
 re-reading, DAMON_LRU_SORT will be disabled.
 
+filter_young_pages
+------------------
+
+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
+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.
+
+Disabled by default.
+
 hot_thres_access_freq
 ---------------------
 
-- 
2.47.3

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

* [PATCH 09/11] Docs/admin-guide/mm/damon/lru_sort: document active_mem_bp parameter
  2026-01-13 15:27 [PATCH 00/11] mm/damon: advance DAMOS-based LRU sorting SeongJae Park
  2026-01-13 15:27 ` [PATCH 03/11] Docs/mm/damon/design: document DAMOS_QUOTA_[IN]ACTIVE_MEM_BP SeongJae Park
  2026-01-13 15:27 ` [PATCH 07/11] Docs/admin-guide/mm/damon/lru_sort: document filter_young_pages SeongJae Park
@ 2026-01-13 15:27 ` SeongJae Park
  2026-01-14  6:05   ` wang lian
  2026-01-13 15:27 ` [PATCH 11/11] Docs/admin-guide/mm/damon/lru_sort: document intervals autotuning SeongJae Park
  3 siblings, 1 reply; 9+ messages in thread
From: SeongJae Park @ 2026-01-13 15:27 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, Liam R. Howlett, David Hildenbrand,
	Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
	Suren Baghdasaryan, Vlastimil Babka, damon, linux-doc,
	linux-kernel, linux-mm

Document a newly added DAMON_LRU_SORT parameter for doing auto-tuning
aiming an active to inactive memory size ratio.

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

diff --git a/Documentation/admin-guide/mm/damon/lru_sort.rst b/Documentation/admin-guide/mm/damon/lru_sort.rst
index bb222a32aefd..6af3ab5579a3 100644
--- a/Documentation/admin-guide/mm/damon/lru_sort.rst
+++ b/Documentation/admin-guide/mm/damon/lru_sort.rst
@@ -79,6 +79,18 @@ of parametrs except ``enabled`` again.  Once the re-reading is done, this
 parameter is set as ``N``.  If invalid parameters are found while the
 re-reading, DAMON_LRU_SORT will be disabled.
 
+active_mem_bp
+-------------
+
+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.
+
+Disabled by default.
+
 filter_young_pages
 ------------------
 
-- 
2.47.3

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

* [PATCH 11/11] Docs/admin-guide/mm/damon/lru_sort: document intervals autotuning
  2026-01-13 15:27 [PATCH 00/11] mm/damon: advance DAMOS-based LRU sorting SeongJae Park
                   ` (2 preceding siblings ...)
  2026-01-13 15:27 ` [PATCH 09/11] Docs/admin-guide/mm/damon/lru_sort: document active_mem_bp parameter SeongJae Park
@ 2026-01-13 15:27 ` SeongJae Park
  2026-01-14  6:30   ` wang lian
  3 siblings, 1 reply; 9+ messages in thread
From: SeongJae Park @ 2026-01-13 15:27 UTC (permalink / raw)
  To: Andrew Morton
  Cc: SeongJae Park, Liam R. Howlett, David Hildenbrand,
	Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
	Suren Baghdasaryan, Vlastimil Babka, damon, linux-doc,
	linux-kernel, linux-mm

Document a newly added DAMON_LRU_SORT module parameter for using
monitoring intervals auto-tuning feature of DAMON.

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

diff --git a/Documentation/admin-guide/mm/damon/lru_sort.rst b/Documentation/admin-guide/mm/damon/lru_sort.rst
index 6af3ab5579a3..20a8378d5a94 100644
--- a/Documentation/admin-guide/mm/damon/lru_sort.rst
+++ b/Documentation/admin-guide/mm/damon/lru_sort.rst
@@ -91,6 +91,17 @@ increases and decreases the effective level of the quota aiming the LRU
 
 Disabled by default.
 
+Auto-tune monitoring intervals
+------------------------------
+
+If this parameter is set as ``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.
+
+Disabled by default.
+
 filter_young_pages
 ------------------
 
-- 
2.47.3

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

* Re: [PATCH 03/11] Docs/mm/damon/design: document DAMOS_QUOTA_[IN]ACTIVE_MEM_BP
  2026-01-13 15:27 ` [PATCH 03/11] Docs/mm/damon/design: document DAMOS_QUOTA_[IN]ACTIVE_MEM_BP SeongJae Park
@ 2026-01-14  2:51   ` wang lian
  0 siblings, 0 replies; 9+ messages in thread
From: wang lian @ 2026-01-14  2:51 UTC (permalink / raw)
  To: sj
  Cc: Liam.Howlett, akpm, corbet, damon, david, linux-doc, linux-kernel,
	linux-mm, lorenzo.stoakes, mhocko, rppt, surenb, vbabka,
	wang lian


> Update design document for newly added DAMOS_QUOTA_[IN]ACTIVE_MEM_BP
> metrics.  Note that API document is automatically updated by kernel-doc
> comment, and the usage document points to the design document which uses
> keywords same to that for sysfs inputs.  Hence updating only design
> document is sufficient.

> Signed-off-by: SeongJae Park <sj@kernel.org>

Hi SeongJae,

The documentation clearly reflects the definition implemented in patch 1.

Acked-by: wang lian <lianux.mm@gmail.com>

--
Best Regards,
wang lian

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

* Re: [PATCH 07/11] Docs/admin-guide/mm/damon/lru_sort: document filter_young_pages
  2026-01-13 15:27 ` [PATCH 07/11] Docs/admin-guide/mm/damon/lru_sort: document filter_young_pages SeongJae Park
@ 2026-01-14  3:25   ` wang lian
  0 siblings, 0 replies; 9+ messages in thread
From: wang lian @ 2026-01-14  3:25 UTC (permalink / raw)
  To: sj
  Cc: Liam.Howlett, akpm, corbet, damon, david, linux-doc, linux-kernel,
	linux-mm, lorenzo.stoakes, mhocko, rppt, surenb, vbabka,
	wang lian


> Document the new DAMON_LRU_SORT parameter, filter_young_pages.  It can
> be used to use page level access re-check for the LRU sorting.

> Signed-off-by: SeongJae Park <sj@kernel.org>

Acked-by: wang lian <lianux.mm@gmail.com>

--
Best Regards,
wang lian

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

* Re: [PATCH 09/11] Docs/admin-guide/mm/damon/lru_sort: document active_mem_bp parameter
  2026-01-13 15:27 ` [PATCH 09/11] Docs/admin-guide/mm/damon/lru_sort: document active_mem_bp parameter SeongJae Park
@ 2026-01-14  6:05   ` wang lian
  0 siblings, 0 replies; 9+ messages in thread
From: wang lian @ 2026-01-14  6:05 UTC (permalink / raw)
  To: sj
  Cc: Liam.Howlett, akpm, corbet, damon, david, linux-doc, linux-kernel,
	linux-mm, lorenzo.stoakes, mhocko, rppt, surenb, vbabka,
	wang lian


> Document a newly added DAMON_LRU_SORT parameter for doing auto-tuning
> aiming an active to inactive memory size ratio.

> Signed-off-by: SeongJae Park <sj@kernel.org>

Acked-by: wang lian <lianux.mm@gmail.com>
--
Best Regards,
wang lian

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

* Re: [PATCH 11/11] Docs/admin-guide/mm/damon/lru_sort: document intervals autotuning
  2026-01-13 15:27 ` [PATCH 11/11] Docs/admin-guide/mm/damon/lru_sort: document intervals autotuning SeongJae Park
@ 2026-01-14  6:30   ` wang lian
  0 siblings, 0 replies; 9+ messages in thread
From: wang lian @ 2026-01-14  6:30 UTC (permalink / raw)
  To: sj
  Cc: Liam.Howlett, akpm, corbet, damon, david, linux-doc, linux-kernel,
	linux-mm, lorenzo.stoakes, mhocko, rppt, surenb, vbabka,
	wang lian


> Document a newly added DAMON_LRU_SORT module parameter for using
> monitoring intervals auto-tuning feature of DAMON.

> Signed-off-by: SeongJae Park <sj@kernel.org>

Acked-by: wang lian <lianux.mm@gmail.com>
--
Best Regards,
wang lian

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

end of thread, other threads:[~2026-01-14  6:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-13 15:27 [PATCH 00/11] mm/damon: advance DAMOS-based LRU sorting SeongJae Park
2026-01-13 15:27 ` [PATCH 03/11] Docs/mm/damon/design: document DAMOS_QUOTA_[IN]ACTIVE_MEM_BP SeongJae Park
2026-01-14  2:51   ` wang lian
2026-01-13 15:27 ` [PATCH 07/11] Docs/admin-guide/mm/damon/lru_sort: document filter_young_pages SeongJae Park
2026-01-14  3:25   ` wang lian
2026-01-13 15:27 ` [PATCH 09/11] Docs/admin-guide/mm/damon/lru_sort: document active_mem_bp parameter SeongJae Park
2026-01-14  6:05   ` wang lian
2026-01-13 15:27 ` [PATCH 11/11] Docs/admin-guide/mm/damon/lru_sort: document intervals autotuning SeongJae Park
2026-01-14  6:30   ` wang lian

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