Commit 5b7708e6 authored by SeongJae Park's avatar SeongJae Park Committed by Andrew Morton

Docs/mm/damon: move the list of DAMOS actions to design doc

DAMOS operation actions are explained nearly twice on the DAMON usage
document, once for the sysfs interface, and then again for the debugfs
interface.  Duplication is bad.  Also it would better to keep this kind of
concept level details in design document and keep the usage document small
and focus on only the usage.  Move the list to design document and update
usage document to reference it.

Link: https://lkml.kernel.org/r/20240217005842.87348-3-sj@kernel.orgSigned-off-by: default avatarSeongJae Park <sj@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 0a1ebc17
...@@ -302,27 +302,8 @@ In each scheme directory, five directories (``access_pattern``, ``quotas``, ...@@ -302,27 +302,8 @@ In each scheme directory, five directories (``access_pattern``, ``quotas``,
The ``action`` file is for setting and getting the scheme's :ref:`action The ``action`` file is for setting and getting the scheme's :ref:`action
<damon_design_damos_action>`. The keywords that can be written to and read <damon_design_damos_action>`. The keywords that can be written to and read
from the file and their meaning are as below. from the file and their meaning are same to those of the list on
:ref:`design doc <damon_design_damos_action>`.
Note that support of each action depends on the running DAMON operations set
:ref:`implementation <sysfs_context>`.
- ``willneed``: Call ``madvise()`` for the region with ``MADV_WILLNEED``.
Supported by ``vaddr`` and ``fvaddr`` operations set.
- ``cold``: Call ``madvise()`` for the region with ``MADV_COLD``.
Supported by ``vaddr`` and ``fvaddr`` operations set.
- ``pageout``: Call ``madvise()`` for the region with ``MADV_PAGEOUT``.
Supported by ``vaddr``, ``fvaddr`` and ``paddr`` operations set.
- ``hugepage``: Call ``madvise()`` for the region with ``MADV_HUGEPAGE``.
Supported by ``vaddr`` and ``fvaddr`` operations set.
- ``nohugepage``: Call ``madvise()`` for the region with ``MADV_NOHUGEPAGE``.
Supported by ``vaddr`` and ``fvaddr`` operations set.
- ``lru_prio``: Prioritize the region on its LRU lists.
Supported by ``paddr`` operations set.
- ``lru_deprio``: Deprioritize the region on its LRU lists.
Supported by ``paddr`` operations set.
- ``stat``: Do nothing but count the statistics.
Supported by all operations sets.
The ``apply_interval_us`` file is for setting and getting the scheme's The ``apply_interval_us`` file is for setting and getting the scheme's
:ref:`apply_interval <damon_design_damos>` in microseconds. :ref:`apply_interval <damon_design_damos>` in microseconds.
...@@ -763,19 +744,17 @@ Action ...@@ -763,19 +744,17 @@ Action
~~~~~~ ~~~~~~
The ``<action>`` is a predefined integer for memory management :ref:`actions The ``<action>`` is a predefined integer for memory management :ref:`actions
<damon_design_damos_action>`. The supported numbers and their meanings are as <damon_design_damos_action>`. The mapping between the ``<action>`` values and
below. the memory management actions is as below. For the detailed meaning of the
action and DAMON operations set supporting each action, please refer to the
- 0: Call ``madvise()`` for the region with ``MADV_WILLNEED``. Ignored if list on :ref:`design doc <damon_design_damos_action>`.
``target`` is ``paddr``.
- 1: Call ``madvise()`` for the region with ``MADV_COLD``. Ignored if - 0: ``willneed``
``target`` is ``paddr``. - 1: ``cold``
- 2: Call ``madvise()`` for the region with ``MADV_PAGEOUT``. - 2: ``pageout``
- 3: Call ``madvise()`` for the region with ``MADV_HUGEPAGE``. Ignored if - 3: ``hugepage``
``target`` is ``paddr``. - 4: ``nohugepage``
- 4: Call ``madvise()`` for the region with ``MADV_NOHUGEPAGE``. Ignored if - 5: ``stat``
``target`` is ``paddr``.
- 5: Do nothing but count the statistics
Quota Quota
~~~~~ ~~~~~
......
...@@ -294,9 +294,29 @@ not mandated to support all actions of the list. Hence, the availability of ...@@ -294,9 +294,29 @@ not mandated to support all actions of the list. Hence, the availability of
specific DAMOS action depends on what operations set is selected to be used specific DAMOS action depends on what operations set is selected to be used
together. together.
Applying an action to a region is considered as changing the region's The list of the supported actions, their meaning, and DAMON operations sets
characteristics. Hence, DAMOS resets the age of regions when an action is that supports each action are as below.
applied to those.
- ``willneed``: Call ``madvise()`` for the region with ``MADV_WILLNEED``.
Supported by ``vaddr`` and ``fvaddr`` operations set.
- ``cold``: Call ``madvise()`` for the region with ``MADV_COLD``.
Supported by ``vaddr`` and ``fvaddr`` operations set.
- ``pageout``: Call ``madvise()`` for the region with ``MADV_PAGEOUT``.
Supported by ``vaddr``, ``fvaddr`` and ``paddr`` operations set.
- ``hugepage``: Call ``madvise()`` for the region with ``MADV_HUGEPAGE``.
Supported by ``vaddr`` and ``fvaddr`` operations set.
- ``nohugepage``: Call ``madvise()`` for the region with ``MADV_NOHUGEPAGE``.
Supported by ``vaddr`` and ``fvaddr`` operations set.
- ``lru_prio``: Prioritize the region on its LRU lists.
Supported by ``paddr`` operations set.
- ``lru_deprio``: Deprioritize the region on its LRU lists.
Supported by ``paddr`` operations set.
- ``stat``: Do nothing but count the statistics.
Supported by all operations sets.
Applying the actions except ``stat`` to a region is considered as changing the
region's characteristics. Hence, DAMOS resets the age of regions when any such
actions are applied to those.
.. _damon_design_damos_access_pattern: .. _damon_design_damos_access_pattern:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment