@@ -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.
307307schemes/<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
314315The ``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
427428DAMON-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
430442number (``N ``) to the file creates the number of child directories named ``0 ``
431443to ``N-1 ``. Each directory represents each filter. The filters are evaluated
432444in 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 ``
436448and ``target_idx ``. To ``type `` file, you can write the type of the filter.
437449Refer 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
440452For ``memcg `` type, you can specify the memory cgroup of the interest by
441453writing 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.
455467For example, below restricts a DAMOS action to be applied to only non-anonymous
456468pages 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