Documentation/mm/damon/design.rst

Source file repositories/reference/linux-study-clean/Documentation/mm/damon/design.rst

File Facts

System
Linux kernel
Corpus path
Documentation/mm/damon/design.rst
Extension
.rst
Size
45758 bytes
Lines
955
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: documentation
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

.. SPDX-License-Identifier: GPL-2.0

======
Design
======


.. _damon_design_execution_model_and_data_structures:

Execution Model and Data Structures
===================================

The monitoring-related information including the monitoring request
specification and DAMON-based operation schemes are stored in a data structure
called DAMON ``context``.  DAMON executes each context with a kernel thread
called ``kdamond``.  Multiple kdamonds could run in parallel, for different
types of monitoring.

To know how user-space can do the configurations and start/stop DAMON, refer to
:ref:`DAMON sysfs interface <sysfs_interface>` documentation.

Users can also request each context execution to be paused and resumed.  When
it is paused, the kdamond does nothing other than applying online parameter
update.

To know how user-space can pause/resume each context, refer to :ref:`DAMON
sysfs context <sysfs_context>` usage documentation.


Overall Architecture
====================

DAMON subsystem is configured with three layers including

- :ref:`Operations Set <damon_operations_set>`: Implements fundamental
  operations for DAMON that depends on the given monitoring target
  address-space and available set of software/hardware primitives,
- :ref:`Core <damon_core_logic>`: Implements core logics including monitoring
  overhead/accuracy control and access-aware system operations on top of the
  operations set layer, and
- :ref:`Modules <damon_modules>`: Implements kernel modules for various
  purposes that provides interfaces for the user space, on top of the core
  layer.


.. _damon_operations_set:

Operations Set Layer
====================

.. _damon_design_configurable_operations_set:

For data access monitoring and additional low level work, DAMON needs a set of
implementations for specific operations that are dependent on and optimized for
the given target address space.  For example, below two operations for access
monitoring are address-space dependent.

1. Identification of the monitoring target address range for the address space.
2. Access check of specific address range in the target space.

DAMON consolidates these implementations in a layer called DAMON Operations
Set, and defines the interface between it and the upper layer.  The upper layer
is dedicated for DAMON's core logics including the mechanism for control of the
monitoring accuracy and the overhead.

Hence, DAMON can easily be extended for any address space and/or available
hardware features by configuring the core logic to use the appropriate
operations set.  If there is no available operations set for a given purpose, a
new operations set can be implemented following the interface between the
layers.

Annotation

Implementation Notes