* [PATCH 6/8] Docs/mm/damon/design: document damos quota goal complement flag
2026-09-29 8:01 [PATCH 0/8] mm/damon: introduce damos quota goal target metric complement flag SJ Park
@ 2026-09-29 8:01 ` SJ Park
2026-09-29 8:01 ` [PATCH 7/8] Docs/admin-guide/mm/damon/usage: update for quota goal complement file SJ Park
2026-09-29 8:17 ` [PATCH 0/8] mm/damon: introduce damos quota goal target metric complement flag SJ Park
2 siblings, 0 replies; 4+ messages in thread
From: SJ Park @ 2026-09-29 8:01 UTC (permalink / raw)
To: Andrew Morton
Cc: SJ Park, Liam R. Howlett, David Hildenbrand, Jonathan Corbet,
Lorenzo Stoakes, Michal Hocko, Mike Rapoport, Randy Dunlap,
Shuah Khan, Suren Baghdasaryan, Vlastimil Babka, damon, linux-doc,
linux-kernel, linux-mm
Update DAMON design document for the newly added damos quota goal metric
value complement flag.
Signed-off-by: SJ Park <sj@kernel.org>
---
Documentation/mm/damon/design.rst | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst
index e82390e77a70..5cd651b1b7aa 100644
--- a/Documentation/mm/damon/design.rst
+++ b/Documentation/mm/damon/design.rst
@@ -702,10 +702,10 @@ There are two such tuning algorithms that users can select as they need.
that the zero quota is a valid quota, and therefore ``qt_exceeds`` :ref:`stat
<damon_design_damos_stat>` will keep increasing in this case.
-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
-``target_value``.
+The goal can be specified with six parameters, namely ``target_metric``,
+``complement``, ``target_value``, ``current_value``, ``nid`` and ``path``. The
+auto-tuning mechanism tries to make ``current_value`` of ``complement``-ed
+``target_metric`` be same to ``target_value``.
- ``user_input``: User-provided value. Users could use any metric that they
has interest in for the value. Use space main workload's latency or
@@ -733,6 +733,13 @@ mechanism tries to make ``current_value`` of ``target_metric`` be same to
- ``hugepage_mem_bp``: Total huge page to total used memory ratio in bp
(1/10,000).
+``complement`` is a boolean parameter that determines whether to use
+complemented value of the target metric. For example, if ``complement`` is set
+and target metric is ``active_mem_bp``, it is effectively same to
+``inactive_mem_bp``. ``complement`` is no-op when the target metric type is
+``user_input``. For the metric type, the user should be able to emit
+complemented metric values on their own.
+
``nid`` is optionally required for ``node_mem_used_bp``, ``node_mem_free_bp``,
``node_memcg_used_bp``, ``node_memcg_free_bp`` and ``node_eligible_mem_bp`` to
point the specific NUMA node.
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 7/8] Docs/admin-guide/mm/damon/usage: update for quota goal complement file
2026-09-29 8:01 [PATCH 0/8] mm/damon: introduce damos quota goal target metric complement flag SJ Park
2026-09-29 8:01 ` [PATCH 6/8] Docs/mm/damon/design: document damos quota goal " SJ Park
@ 2026-09-29 8:01 ` SJ Park
2026-09-29 8:17 ` [PATCH 0/8] mm/damon: introduce damos quota goal target metric complement flag SJ Park
2 siblings, 0 replies; 4+ messages in thread
From: SJ Park @ 2026-09-29 8:01 UTC (permalink / raw)
To: Andrew Morton
Cc: SJ Park, Liam R. Howlett, David Hildenbrand, Jonathan Corbet,
Lorenzo Stoakes, Michal Hocko, Mike Rapoport, Randy Dunlap,
Shuah Khan, Suren Baghdasaryan, Vlastimil Babka, damon, linux-doc,
linux-kernel, linux-mm
Update DAMON usage document for the newly added quota goal metric
complement sysfs file.
Signed-off-by: SJ Park <sj@kernel.org>
---
Documentation/admin-guide/mm/damon/usage.rst | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index ba4725544856..3d43954c7046 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -98,7 +98,8 @@ comma (",").
│ │ │ │ │ │ │ fail_charge_num,fail_charge_denom
│ │ │ │ │ │ │ │ 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
+ │ │ │ │ │ │ │ │ │ 0/target_metric,complement,target_value,
+ │ │ │ │ │ │ │ │ │ current_value,nid,path
│ │ │ │ │ │ │ :ref:`watermarks <sysfs_watermarks>`/metric,interval_us,high,mid,low
│ │ │ │ │ │ │ :ref:`{core_,ops_,}filters <sysfs_filters>`/nr_filters
│ │ │ │ │ │ │ │ 0/type,matching,allow,memcg_path,addr_start,addr_end,damon_target_idx,min,max
@@ -492,12 +493,12 @@ number (``N``) to the file creates the number of child directories named ``0``
to ``N-1``. Each directory represents each goal and current achievement.
Among the multiple feedback, the best one is used.
-Each goal directory contains five files, namely ``target_metric``,
-``target_value``, ``current_value``, ``nid``, and ``path``. Users can set and
-get the five parameters for the quota auto-tuning goals that specified on the
-:ref:`design doc <damon_design_damos_quotas_auto_tuning>` by writing to and
-reading from each of the files. Because the kernel does not update
-``current_value``, reading it only makes sense when ``target_metric`` is
+Each goal directory contains six files, namely ``target_metric``,
+``complement``, ``target_value``, ``current_value``, ``nid``, and ``path``.
+Users can set and get the six parameters for the quota auto-tuning goals that
+specified on the :ref:`design doc <damon_design_damos_quotas_auto_tuning>` by
+writing to and reading from each of the files. Because the kernel does not
+update ``current_value``, reading it only makes sense when ``target_metric`` is
``user_input``. Note that users should further write
``commit_schemes_quota_goals`` to the ``state`` file of the :ref:`kdamond
directory <sysfs_kdamond>` to pass the feedback to DAMON.
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 0/8] mm/damon: introduce damos quota goal target metric complement flag
2026-09-29 8:01 [PATCH 0/8] mm/damon: introduce damos quota goal target metric complement flag SJ Park
2026-09-29 8:01 ` [PATCH 6/8] Docs/mm/damon/design: document damos quota goal " SJ Park
2026-09-29 8:01 ` [PATCH 7/8] Docs/admin-guide/mm/damon/usage: update for quota goal complement file SJ Park
@ 2026-09-29 8:17 ` SJ Park
2 siblings, 0 replies; 4+ messages in thread
From: SJ Park @ 2026-09-29 8:17 UTC (permalink / raw)
To: SJ Park
Cc: Andrew Morton, Liam R. Howlett, Brendan Higgins, David Gow,
David Hildenbrand, Jonathan Corbet, Lorenzo Stoakes, Michal Hocko,
Mike Rapoport, Randy Dunlap, Shuah Khan, Shuah Khan,
Suren Baghdasaryan, Vlastimil Babka, damon, kunit-dev, linux-doc,
linux-kernel, linux-kselftest, linux-mm
On Tue, 29 Sep 2026 01:01:03 -0700 SJ Park <sj@kernel.org> wrote:
[...]
> Add a new flag, quota goal complement, to allow flexible tuning goal
> setup without unnecessarily increasing the number of metrics. The flag
> specifies whether to use the complemented value of the given goal metric
> for the tuning. For example, if the complement flag is set, the upper
> tier memory utilization ratio metric works the same as the free memory
> ratio metric for the tier.
Sashiko found no blocker for this series. Sashiko sends its findings to damon@
mailing list [1], and I reply those if anything needs to be clarified. Please
refer to those for details.
[1] https://lore.kernel.org/damon/
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 4+ messages in thread