Skip to content

Commit 114b480

Browse files
sjp38akpm00
authored andcommitted
Docs/admin-guide/mm/damon/usage: update for {core,ops}_filters directories
Document {core,ops}_filters directories on usage document. Link: https://lkml.kernel.org/r/20250305222733.59089-9-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 899e4c1 commit 114b480

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

Documentation/admin-guide/mm/damon/usage.rst

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ comma (",").
8383
│ │ │ │ │ │ │ │ :ref:`goals <sysfs_schemes_quota_goals>`/nr_goals
8484
│ │ │ │ │ │ │ │ │ 0/target_metric,target_value,current_value
8585
│ │ │ │ │ │ │ :ref:`watermarks <sysfs_watermarks>`/metric,interval_us,high,mid,low
86-
│ │ │ │ │ │ │ :ref:`filters <sysfs_filters>`/nr_filters
86+
│ │ │ │ │ │ │ :ref:`{core_,ops_,}filters <sysfs_filters>`/nr_filters
8787
│ │ │ │ │ │ │ │ 0/type,matching,allow,memcg_path,addr_start,addr_end,target_idx,min,max
8888
│ │ │ │ │ │ │ :ref:`stats <sysfs_schemes_stats>`/nr_tried,sz_tried,nr_applied,sz_applied,sz_ops_filter_passed,qt_exceeds
8989
│ │ │ │ │ │ │ :ref:`tried_regions <sysfs_schemes_tried_regions>`/total_bytes
@@ -307,9 +307,10 @@ to ``N-1``. Each directory represents each DAMON-based operation scheme.
307307
schemes/<N>/
308308
------------
309309

310-
In each scheme directory, five directories (``access_pattern``, ``quotas``,
311-
``watermarks``, ``filters``, ``stats``, and ``tried_regions``) and three files
312-
(``action``, ``target_nid`` and ``apply_interval``) exist.
310+
In each scheme directory, seven directories (``access_pattern``, ``quotas``,
311+
``watermarks``, ``core_filters``, ``ops_filters``, ``filters``, ``stats``, and
312+
``tried_regions``) and three files (``action``, ``target_nid`` and
313+
``apply_interval``) exist.
313314

314315
The ``action`` file is for setting and getting the scheme's :ref:`action
315316
<damon_design_damos_action>`. The keywords that can be written to and read
@@ -420,13 +421,24 @@ The ``interval`` should written in microseconds unit.
420421

421422
.. _sysfs_filters:
422423

423-
schemes/<N>/filters/
424-
--------------------
424+
schemes/<N>/{core\_,ops\_,}filters/
425+
-----------------------------------
425426

426-
The directory for the :ref:`filters <damon_design_damos_filters>` of the given
427+
Directories for :ref:`filters <damon_design_damos_filters>` of the given
427428
DAMON-based operation scheme.
428429

429-
In the beginning, this directory has only one file, ``nr_filters``. Writing a
430+
``core_filters`` and ``ops_filters`` directories are for the filters handled by
431+
the DAMON core layer and operations set layer, respectively. ``filters``
432+
directory can be used for installing filters regardless of their handled
433+
layers. Filters that requested by ``core_filters`` and ``ops_filters`` will be
434+
installed before those of ``filters``. All three directories have same files.
435+
436+
Use of ``filters`` directory can make expecting evaluation orders of given
437+
filters with the files under directory bit confusing. Users are hence
438+
recommended to use ``core_filters`` and ``ops_filters`` directories. The
439+
``filters`` directory could be deprecated in future.
440+
441+
In the beginning, the directory has only one file, ``nr_filters``. Writing a
430442
number (``N``) to the file creates the number of child directories named ``0``
431443
to ``N-1``. Each directory represents each filter. The filters are evaluated
432444
in the numeric order.
@@ -435,7 +447,7 @@ Each filter directory contains nine files, namely ``type``, ``matching``,
435447
``allow``, ``memcg_path``, ``addr_start``, ``addr_end``, ``min``, ``max``
436448
and ``target_idx``. To ``type`` file, you can write the type of the filter.
437449
Refer to :ref:`the design doc <damon_design_damos_filters>` for available type
438-
names and their meanings.
450+
names, their meaning and on what layer those are handled.
439451

440452
For ``memcg`` type, you can specify the memory cgroup of the interest by
441453
writing the path of the memory cgroup from the cgroups mount point to
@@ -455,6 +467,7 @@ the ``type`` and ``matching`` should be allowed or not.
455467
For example, below restricts a DAMOS action to be applied to only non-anonymous
456468
pages of all memory cgroups except ``/having_care_already``.::
457469

470+
# cd ops_filters/0/
458471
# echo 2 > nr_filters
459472
# # disallow anonymous pages
460473
echo anon > 0/type

0 commit comments

Comments
 (0)