* [RFC PATCH 00/17] mm/damon: introduce data access-as-a-data attribute
@ 2026-07-25 21:02 SJ Park
2026-07-25 21:02 ` [RFC PATCH 04/17] Docs/mm/damon/design: document pgidle_unset probe filter type SJ Park
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: SJ Park @ 2026-07-25 21:02 UTC (permalink / raw)
Cc: SJ Park, Liam R. Howlett, Andrew Morton, David Hildenbrand,
Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
Shuah Khan, Shuah Khan, Suren Baghdasaryan, Vlastimil Babka,
damon, linux-doc, linux-kernel, linux-kselftest, linux-mm
TL;DR: extend DAMON's data attributes monitoring system to support page
table accessed bit and PG_idle based access monitoring.
DAMON was initially introduced as a data access monitor. Users found
data access pattern becomes more useful when it is combined with other
data attributes such as belonging cgroups and backing page types. For
such cases, DAMON has extended to support such data attributes
monitoring in addition to the original data access monitoring. The
DAMON probes system was introduced for this purpose. Users set probes
for filtering data attributes of their interest. For use cases where
the primary interests are the attributes but the access pattern, probe
weights system has been introduced. When it is used, DAMON applies its
adaptive regions adjustment based on the monitored data attributes.
However, DAMON stops access monitoring when the probe weights are used.
DAMON cannot optimally help users who have interests in both data
attributes and access patterns. Data access can also be thought of as
another data attribute, though. Extend the probe system to support data
access as a data attribute.
Introduce a new probe filter type, pgidle_unset. It shows if the page
is not set as idle. Specifically, it shows the page table accessed bit
and the PG_idle flag. It can inform if the region is ever accessed. But
it cannot say when it is accessed. To answer the second question,
introduce a new probe feature, prep actions. Using the features, Users
can specify what preparation actions should be made to each region for
each probe. DAMON executes the preparation actions for each sampling
interval, like it is doing the preparation for access check in the
access monitoring mode. To help 'pgidle_unset' probe action use case,
'set_pgidle' preparation action is introduced together. The action does
exactly what the access monitoring was doing: clearing the page table
accessed bits and setting the PG_idle flags.
Patches Sequence
================
First four patches (patches 1-4) introduce the new probe filter type for
knowing if a region is accessed. Patch 1 defines the new type in the
core. Patch 2 implements the execution of the new filter in the
physical address space DAMON operation set. Patch 3 implements a user
interface on DAMON sysfs interface. Patch 4 updates the documentation
for the new filter type.
Following 13 patches (patches 5-17) introduce the probe preparation
actions feature. Patch 5 defines the data structure for specifying the
preparation actions. Patch 6 completes setup of the API parameter for
the prep. Patch 7 extends the DAMON operation set callback list to
connect the parameter with the underlying operation set. Patch 8
implements the execution of the prep in the physical address space DAMON
operation set.
Following five patches (patches 9-13) extends DAMON sysfs interface for
the new prep feature. Patch 14 adds simple selftest for basic file
operations of the new sysfs files. Final three patches (patches 15-17)
respectively update design, usage and ABI documents for the new feature
and its interface.
SJ Park (17):
mm/damon/core: introduce DAMON_FILTER_TYPE_PGIDLE_UNSET
mm/damon/paddr: support PGIDLE_UNSET probe filter type
mm/damon/sysfs: support pgidle_unset probe filter type
Docs/mm/damon/design: document pgidle_unset probe filter type
mm/damon/core: introduce damon_prep struct
mm/damon/core: commit preps
mm/damon/core: introduce damon_operations->prep_probes()
mm/damon/paddr: support damon_prep
mm/damon/sysfs: implement preps directory
mm/damon/sysfs: create probe preps directory
mm/damon/sysfs: implement probe prep directory
mm/damon/sysfs: create probe prep files for preps/nr file write
mm/damon/sysfs: pass preps to DAMON core
selftests/damon/sysfs.sh: test probe prep sysfs files
Docs/mm/damon/design: document probe preps
Docs/admin-guide/mm/damon/usage: document probe preps sysfs files
Docs/ABI/damon: document probe prep sysfs files
.../ABI/testing/sysfs-kernel-mm-damon | 13 +
Documentation/admin-guide/mm/damon/usage.rst | 18 +-
Documentation/mm/damon/design.rst | 17 +-
include/linux/damon.h | 42 ++-
mm/damon/core.c | 103 ++++++-
mm/damon/paddr.c | 41 +++
mm/damon/sysfs.c | 280 +++++++++++++++++-
tools/testing/selftests/damon/sysfs.sh | 27 ++
8 files changed, 527 insertions(+), 14 deletions(-)
base-commit: 7c69a13f116ab63f525a2c4b0be7ce89f73befcd
--
2.47.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [RFC PATCH 04/17] Docs/mm/damon/design: document pgidle_unset probe filter type
2026-07-25 21:02 [RFC PATCH 00/17] mm/damon: introduce data access-as-a-data attribute SJ Park
@ 2026-07-25 21:02 ` SJ Park
2026-07-25 21:02 ` [RFC PATCH 15/17] Docs/mm/damon/design: document probe preps SJ Park
2026-07-25 21:02 ` [RFC PATCH 16/17] Docs/admin-guide/mm/damon/usage: document probe preps sysfs files SJ Park
2 siblings, 0 replies; 4+ messages in thread
From: SJ Park @ 2026-07-25 21:02 UTC (permalink / raw)
Cc: SJ Park, Liam R. Howlett, Andrew Morton, David Hildenbrand,
Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
Shuah Khan, Suren Baghdasaryan, Vlastimil Babka, damon, linux-doc,
linux-kernel, linux-mm
Update DAMON design document for the newly added pgidle_unset probe
filter type. Also use a list for the types, as it becomes not very easy
to read the whole types in a simple sentence.
Signed-off-by: SJ Park <sj@kernel.org>
---
Documentation/mm/damon/design.rst | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst
index a8c163475ef2b..12a2c3f81a262 100644
--- a/Documentation/mm/damon/design.rst
+++ b/Documentation/mm/damon/design.rst
@@ -293,8 +293,14 @@ registration is made by specifying a probe per attribute. Each of the probe
specifies a rule to determine if a given memory region has the related
attribute. The rule is constructed with multiple filters. The filters work
same to :ref:`DAMOS filters <damon_design_damos_filters>` except the supported
-filter types. Currently only ``anon`` and ``memcg`` filter types are supported
-for data attributes monitoring.
+filter types. Currently below fitler types are supported.
+
+- ``anon``: Same to that for DAMOS filters.
+- ``memcg``: Same to that for DAMOS filters.
+- ``pgidle_unset``: Matches if the page for the memory is marked as not
+ access-idle.
+ Matches if the memory is not backed by pages that DAMON can idnetify
+ idleness.
If such probes are registered, DAMON executes the probes for each region's
sampling memory when it does the access :ref:`sampling
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [RFC PATCH 15/17] Docs/mm/damon/design: document probe preps
2026-07-25 21:02 [RFC PATCH 00/17] mm/damon: introduce data access-as-a-data attribute SJ Park
2026-07-25 21:02 ` [RFC PATCH 04/17] Docs/mm/damon/design: document pgidle_unset probe filter type SJ Park
@ 2026-07-25 21:02 ` SJ Park
2026-07-25 21:02 ` [RFC PATCH 16/17] Docs/admin-guide/mm/damon/usage: document probe preps sysfs files SJ Park
2 siblings, 0 replies; 4+ messages in thread
From: SJ Park @ 2026-07-25 21:02 UTC (permalink / raw)
Cc: SJ Park, Liam R. Howlett, Andrew Morton, David Hildenbrand,
Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
Shuah Khan, Suren Baghdasaryan, Vlastimil Babka, damon, linux-doc,
linux-kernel, linux-mm
Update DAMON design document for the newly added DAMN probe preps
feature.
Signed-off-by: SJ Park <sj@kernel.org>
---
Documentation/mm/damon/design.rst | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst
index 12a2c3f81a262..5ce777c6b3f30 100644
--- a/Documentation/mm/damon/design.rst
+++ b/Documentation/mm/damon/design.rst
@@ -311,6 +311,13 @@ Users can therefore know how much of a given DAMON region has a specific data
attribute by reading the per-region per-probe probe hits counter after each
aggregation interval.
+Users can optionally register probing preparation actions per probe. If such
+actions are registered, DAMON applies the actions to each region's sampling
+memory before starting the next sampling interval. Currently only one action,
+``set_pgidle`` is supported. The action marks the page for the probing target
+memory as access-idle. This can be useful to be used together with
+``pgidle_unset`` probe filter.
+
This is a sampling based mechanism. Hence, it is lightweight but the output
may include some measurement errors. The output should be used with good
understanding of statistics.
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [RFC PATCH 16/17] Docs/admin-guide/mm/damon/usage: document probe preps sysfs files
2026-07-25 21:02 [RFC PATCH 00/17] mm/damon: introduce data access-as-a-data attribute SJ Park
2026-07-25 21:02 ` [RFC PATCH 04/17] Docs/mm/damon/design: document pgidle_unset probe filter type SJ Park
2026-07-25 21:02 ` [RFC PATCH 15/17] Docs/mm/damon/design: document probe preps SJ Park
@ 2026-07-25 21:02 ` SJ Park
2 siblings, 0 replies; 4+ messages in thread
From: SJ Park @ 2026-07-25 21:02 UTC (permalink / raw)
Cc: SJ Park, Liam R. Howlett, Andrew Morton, David Hildenbrand,
Jonathan Corbet, Lorenzo Stoakes, Michal Hocko, Mike Rapoport,
Shuah Khan, Suren Baghdasaryan, Vlastimil Babka, damon, linux-doc,
linux-kernel, linux-mm
Update DAMON usage document for the newly added DAMON probe preps sysfs
files.
Signed-off-by: SJ Park <sj@kernel.org>
---
Documentation/admin-guide/mm/damon/usage.rst | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index da5f9afd08aef..1f5a39e1fc38d 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -74,6 +74,9 @@ comma (",").
│ │ │ │ │ │ nr_regions/min,max
│ │ │ │ │ │ :ref:`probes <damon_usage_sysfs_probes>`/nr_probes
│ │ │ │ │ │ │ 0/weight
+ │ │ │ │ │ │ │ │ preps/nr_preps
+ │ │ │ │ │ │ │ │ │ 0/prep_action
+ │ │ │ │ │ │ │ │ │ ...
│ │ │ │ │ │ │ │ filters/nr_filters
│ │ │ │ │ │ │ │ │ 0/type,matching,allow,path
│ │ │ │ │ │ │ │ │ ...
@@ -283,9 +286,18 @@ In the beginning, this directory has only one file, ``nr_probes``. Writing a
number (``N``) to the file creates the number of child directories named ``0``
to ``N-1``. Each directory represents each monitoring probe.
-In each probe directory, one directory, ``filters`` exists. The directory
-contains files for installing filters for the probe, that is used to determine
-the data attribute for the probe.
+In each probe directory, two directories, ``preps`` and ``filters`` exists.
+The directories contains files for installing probing preparation actions and
+filters for the probe, that is used to determine the data attribute for the
+probe.
+
+In the beginning, ``preps`` directory has only one file, ``nr_preps``.
+Writiing a number (``N``) to the file creates the number of child directories
+names ``0`` to ``N-1``. Each directory represents each preparation action.
+Each directory has one file, ``prep_action``. The preparation action can be
+selected by writing the name of the action to the ``prep_action`` file. Refer
+to the :ref:`design doc <damon_design_data_attrs_monitoring>` for the list of
+supported actions.
Each probe directory also contains ``weight`` file. Reading from and writing
to the file gets and sets the :ref:`attributes-only monitoring
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-25 21:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-25 21:02 [RFC PATCH 00/17] mm/damon: introduce data access-as-a-data attribute SJ Park
2026-07-25 21:02 ` [RFC PATCH 04/17] Docs/mm/damon/design: document pgidle_unset probe filter type SJ Park
2026-07-25 21:02 ` [RFC PATCH 15/17] Docs/mm/damon/design: document probe preps SJ Park
2026-07-25 21:02 ` [RFC PATCH 16/17] Docs/admin-guide/mm/damon/usage: document probe preps sysfs files SJ Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox