public inbox for linux-doc@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/5] mm/damon: support multiple goal-based quota tuning algorithms
@ 2026-02-12  6:23 SeongJae Park
  2026-02-12  6:23 ` [RFC PATCH 4/5] Docs/mm/damon/design: document the goal-based quota tuner selections SeongJae Park
  2026-02-12  6:23 ` [RFC PATCH 5/5] Docs/admin-guide/mm/damon/usage: document goal_tuner sysfs file SeongJae Park
  0 siblings, 2 replies; 3+ messages in thread
From: SeongJae Park @ 2026-02-12  6:23 UTC (permalink / raw)
  Cc: SeongJae Park, Liam R. Howlett, Andrew Morton, David Hildenbrand,
	Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
	Suren Baghdasaryan, Vlastimil Babka, damon, linux-doc,
	linux-kernel, linux-mm

Aim-oriented DAMOS quota atuo-tuning uses a single tuning algorithm.
The algorithm is designed to find a non-zero quota that should be
consistently kept for achieving the aimed goal for long term.  In other
words, the algorithm assumes the goal will be under-achieved once the
DAMOS scheme is completely deactivated.  Memory pressure level is one
good example of such an assumed goal metric.

It is particularly useful for long term automated kernel-only operations
on dynamic environments.  As always, however, no single algorithm fits
all.  When the environment has static characteristics and the goal
metric has no factor to move without additional intervention, the
algorithm is difficult to control and accurately achieve the goal.
Systems running by not only the kernel but with some user space controls
can be examples.  Actually there were reports [1,2] of such cases.

Extend DAMOS quotas goal core API and sysfs ABI to support multiple
quota tuning algorithms that the API callers and/or ABI users can
select.  Keep the current algorithm as the default one, to keep the
default behavior unchanged.  Also give it a name, "consist", as it is
designed to "consistently" apply the DAMOS action.  And introduce a new
tuning algorithm, namely "temporal".  It is designed to apply the DAMOS
action only temporally until the goal is achieved, in a deterministic
way.  In more detail, as long as the goal is under-achieved, it uses the
maximum quota available.  Once the goal is over-achieved, it sets the
quota zero.

[1] https://lore.kernel.org/CALa+Y17__d=ZsM1yX+MXx0ozVdsXnFqF4p0g+kATEitrWyZFfg@mail.gmail.com
[2] https://lore.kernel.org/20260204022537.814-1-yunjeong.mun@sk.com

SeongJae Park (5):
  mm/damon/core: introduce damos_quota_goal_tuner
  mm/damon/core: introduce DAMOS_QUOTA_GOAL_TUNER_TEMPORAL
  mm/damon/sysfs-schemes: implement quotas->goal_tuner file
  Docs/mm/damon/design: document the goal-based quota tuner selections
  Docs/admin-guide/mm/damon/usage: document goal_tuner sysfs file

 Documentation/admin-guide/mm/damon/usage.rst | 16 ++++--
 Documentation/mm/damon/design.rst            | 12 ++++
 include/linux/damon.h                        | 11 ++++
 mm/damon/core.c                              | 33 +++++++++--
 mm/damon/sysfs-schemes.c                     | 58 ++++++++++++++++++++
 5 files changed, 120 insertions(+), 10 deletions(-)


base-commit: 3c44a1294328e58fcf8708f8d1c2ddcb03178966
-- 
2.47.3

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

* [RFC PATCH 4/5] Docs/mm/damon/design: document the goal-based quota tuner selections
  2026-02-12  6:23 [RFC PATCH 0/5] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
@ 2026-02-12  6:23 ` SeongJae Park
  2026-02-12  6:23 ` [RFC PATCH 5/5] Docs/admin-guide/mm/damon/usage: document goal_tuner sysfs file SeongJae Park
  1 sibling, 0 replies; 3+ messages in thread
From: SeongJae Park @ 2026-02-12  6:23 UTC (permalink / raw)
  Cc: SeongJae Park, Liam R. Howlett, Andrew Morton, David Hildenbrand,
	Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
	Suren Baghdasaryan, Vlastimil Babka, damon, linux-doc,
	linux-kernel, linux-mm

Document the newly added goal-based quota tuner selection feature.
Provide the list of the available tuner with descriptions of their
behaviors and when those can be used.

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

diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst
index dd64f5d7f3193..28d932ceaf7ed 100644
--- a/Documentation/mm/damon/design.rst
+++ b/Documentation/mm/damon/design.rst
@@ -564,6 +564,18 @@ aggressiveness (the quota) of the corresponding scheme.  For example, if DAMOS
 is under achieving the goal, DAMOS automatically increases the quota.  If DAMOS
 is over achieving the goal, it decreases the quota.
 
+There are two such tuning algorithms that users can select as they need.
+
+- ``consist``: A proportional feedback loop based algorithm.  Tries to find an
+  optimum quota that should be consistently kept, to keep achieving the goal.
+  Useful for kernel-only operation on dynamic and long-running environments.
+  This is the default selection.  If unsure, use this.
+- ``temporal``: More straightforward algorithm.  Tries to achieve the goal as
+  fast as possible, using maximum allowed quota, but only for a temporal short
+  time.  When the quota is under-achieved, this algorithm keeps tuning quota to
+  a maximum allowed one.  Once the quota is [over]-achieved, this sets the
+  quota zero.  Useful for deterministic control required environments.
+
 The goal can be specified with five parameters, namely ``target_metric``,
 ``target_value``, ``current_value``, ``nid`` and ``path``.  The auto-tuning
 mechanism tries to make ``current_value`` of ``target_metric`` be same to
-- 
2.47.3

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

* [RFC PATCH 5/5] Docs/admin-guide/mm/damon/usage: document goal_tuner sysfs file
  2026-02-12  6:23 [RFC PATCH 0/5] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
  2026-02-12  6:23 ` [RFC PATCH 4/5] Docs/mm/damon/design: document the goal-based quota tuner selections SeongJae Park
@ 2026-02-12  6:23 ` SeongJae Park
  1 sibling, 0 replies; 3+ messages in thread
From: SeongJae Park @ 2026-02-12  6:23 UTC (permalink / raw)
  Cc: SeongJae Park, Liam R. Howlett, Andrew Morton, David Hildenbrand,
	Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
	Suren Baghdasaryan, Vlastimil Babka, damon, linux-doc,
	linux-kernel, linux-mm

Update the DAMON usage document for the new sysfs file for the goal
based quota auto-tuning, 'goal_tuner'.

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

diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index b0f3969b6b3b1..534e1199cf091 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -83,7 +83,7 @@ comma (",").
     │ │ │ │ │ │ │ │ sz/min,max
     │ │ │ │ │ │ │ │ nr_accesses/min,max
     │ │ │ │ │ │ │ │ age/min,max
-    │ │ │ │ │ │ │ :ref:`quotas <sysfs_quotas>`/ms,bytes,reset_interval_ms,effective_bytes
+    │ │ │ │ │ │ │ :ref:`quotas <sysfs_quotas>`/ms,bytes,reset_interval_ms,effective_bytes,goal_tuner
     │ │ │ │ │ │ │ │ weights/sz_permil,nr_accesses_permil,age_permil
     │ │ │ │ │ │ │ │ :ref:`goals <sysfs_schemes_quota_goals>`/nr_goals
     │ │ │ │ │ │ │ │ │ 0/target_metric,target_value,current_value,nid,path
@@ -377,9 +377,9 @@ schemes/<N>/quotas/
 The directory for the :ref:`quotas <damon_design_damos_quotas>` of the given
 DAMON-based operation scheme.
 
-Under ``quotas`` directory, four files (``ms``, ``bytes``,
-``reset_interval_ms``, ``effective_bytes``) and two directories (``weights`` and
-``goals``) exist.
+Under ``quotas`` directory, five files (``ms``, ``bytes``,
+``reset_interval_ms``, ``effective_bytes`` and ``goal_tuner``) and two
+directories (``weights`` and ``goals``) exist.
 
 You can set the ``time quota`` in milliseconds, ``size quota`` in bytes, and
 ``reset interval`` in milliseconds by writing the values to the three files,
@@ -390,6 +390,14 @@ apply the action to only up to ``bytes`` bytes of memory regions within the
 quota limits unless at least one :ref:`goal <sysfs_schemes_quota_goals>` is
 set.
 
+You can set the goal-based effective quota auto-tuning algorithm to use, by
+writing the algorithm name to ``goal_tuner`` file.  Reading the file returns
+the currently selected tuner algorithm.  Refer to the design documentation of
+:ref:`automatic quota tuning goals <damon_design_damos_quotas_auto_tuning>` for
+the background design of the feature and the name of the selectable algorithms.
+Refer to :ref:`goals directory <sysfs_schemes_quota_goals>` for the goals
+setup.
+
 The time quota is internally transformed to a size quota.  Between the
 transformed size quota and user-specified size quota, smaller one is applied.
 Based on the user-specified :ref:`goal <sysfs_schemes_quota_goals>`, the
-- 
2.47.3

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

end of thread, other threads:[~2026-02-12  6:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-12  6:23 [RFC PATCH 0/5] mm/damon: support multiple goal-based quota tuning algorithms SeongJae Park
2026-02-12  6:23 ` [RFC PATCH 4/5] Docs/mm/damon/design: document the goal-based quota tuner selections SeongJae Park
2026-02-12  6:23 ` [RFC PATCH 5/5] Docs/admin-guide/mm/damon/usage: document goal_tuner sysfs 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