Lines Matching +full:allow +full:- +full:set +full:- +full:time
1 .. SPDX-License-Identifier: GPL-2.0
13 The monitoring-related information including the monitoring request
14 specification and DAMON-based operation schemes are stored in a data structure
19 To know how user-space can do the configurations and start/stop DAMON, refer to
28 - :ref:`Operations Set <damon_operations_set>`: Implements fundamental
30 address-space and available set of software/hardware primitives,
31 - :ref:`Core <damon_core_logic>`: Implements core logics including monitoring
32 overhead/accuracy control and access-aware system operations on top of the
33 operations set layer, and
34 - :ref:`Modules <damon_modules>`: Implements kernel modules for various
41 Operations Set Layer
46 For data access monitoring and additional low level work, DAMON needs a set of
49 monitoring are address-space dependent.
55 Set, and defines the interface between it and the upper layer. The upper layer
61 operations set. If there is no available operations set for a given purpose, a
62 new operations set can be implemented following the interface between the
73 - vaddr: Monitor virtual address spaces of specific processes
74 - fvaddr: Monitor fixed virtual address ranges
75 - paddr: Monitor the physical address space of the system
77 To know how user-space can do the configuration via :ref:`DAMON sysfs interface
84 VMA-based Target Address Range Construction
85 -------------------------------------------
87 A mechanism of ``vaddr`` DAMON operations set that automatically initializes
91 This mechanism is only for the ``vaddr`` operations set. In cases of
92 ``fvaddr`` and ``paddr`` operation sets, users are asked to manually set the
95 Only small parts in the super-huge virtual address space of the processes are
101 be removed to not take the time for the adaptive mechanism.
107 heap and the uppermost mmap()-ed region, and the gap between the lowermost
108 mmap()-ed region and the stack in most of the cases. Because these gaps are
110 to make a reasonable trade-off. Below shows this in detail::
114 <uppermost mmap()-ed region>
115 (small mmap()-ed regions and munmap()-ed regions)
116 <lowermost mmap()-ed region>
121 PTE Accessed-bit Based Access Check
122 -----------------------------------
125 Accessed-bit for basic access checks. Only one difference is the way of
131 bit(s) set again after one sampling period. This could disturb other kernel
141 ------------
144 ranges. In some cases, the address space for a given operations set could be
145 too large to be handled with the type. ARM (32-bit) with large physical
146 address extension is an example. For such cases, a per-operations set
150 up to each operations set implementation. ``paddr`` is the only operations set
161 ----------
168 To know how user-space can set the attributes via :ref:`DAMON sysfs interface
183 clears the results. This can be described in below simple pseudo-code::
189 if time() % aggregation_interval == 0:
213 controllable by setting the number of regions. DAMON allows users to set the
214 minimum and the maximum number of regions for the trade-off.
237 threshold until the upper-limit of the number of regions is met, or the
241 three regions if the total number of regions will not exceed the user-specified
244 In this way, DAMON provides its best-effort quality and minimal overhead while
245 keeping the bounds users set for their trade-off.
269 be hot-plugged.
273 and applies it to monitoring operations-related data structures such as the
274 abstracted monitoring target memory area only for each of a user-specified time
277 User-space can get the monitoring results via DAMON sysfs interface and/or
288 In short, set ``aggregation interval`` to capture meaningful amount of accesses
292 cases. Set ``sampling interval`` proportional to ``aggregation interval``. By
295 ``Aggregation interval`` should be set as the time interval that the workload
299 For many purposes, that would be useless. If it is too long, however, the time
302 time scale of the given purpose. This could happen if the workload is actually
319 ``Sampling interval`` defines the resolution of each aggregation. If it is set
327 lowered. It is recommended to be set proportional to ``aggregation interval``.
328 By default, the ratio is set as ``1/20``, and it is still recommended.
330 Based on the manual tuning guide, DAMON provides more intuitive knob-based
344 Monitoring Intervals Auto-tuning
350 users to set the aimed amount of access events to observe via DAMON within
351 given time interval. The target can be specified by the user as a ratio of
352 DAMON-observed access events to the theoretical maximum amount of the events
356 The DAMON-observed access events are calculated in byte granularity based on
370 The user can further set the minimum and maximum ``sampling interval`` that can
371 be set by the tuning mechanism using two parameters (``min_sample_us`` and
374 ``aggregation interval`` after each of the tuning changes can automatically set
377 The tuning is turned off by default, and need to be set explicitly by the user.
380 That is, assumes 4% (20% of 20%) DAMON-observed access events ratio (source)
383 To know how user-space can use this feature via :ref:`DAMON sysfs interface
391 -----------------
393 One common purpose of data access monitoring is access-aware system efficiency
403 One straightforward approach for such schemes would be profile-guided
419 To allow users to reduce such redundancy and inefficiencies by offloading the
420 works, DAMON provides a feature called Data Access Monitoring-based Operation
423 the access pattern of interest, and applies the user-desired operation actions
424 to the regions, for every user-specified time interval called
427 To know how user-space can set ``apply_interval`` via :ref:`DAMON sysfs
443 each action is in the DAMON operations set layer because the implementation
448 specific DAMOS action depends on what operations set is selected to be used
454 - ``willneed``: Call ``madvise()`` for the region with ``MADV_WILLNEED``.
455 Supported by ``vaddr`` and ``fvaddr`` operations set.
456 - ``cold``: Call ``madvise()`` for the region with ``MADV_COLD``.
457 Supported by ``vaddr`` and ``fvaddr`` operations set.
458 - ``pageout``: Reclaim the region.
459 Supported by ``vaddr``, ``fvaddr`` and ``paddr`` operations set.
460 - ``hugepage``: Call ``madvise()`` for the region with ``MADV_HUGEPAGE``.
461 Supported by ``vaddr`` and ``fvaddr`` operations set.
462 - ``nohugepage``: Call ``madvise()`` for the region with ``MADV_NOHUGEPAGE``.
463 Supported by ``vaddr`` and ``fvaddr`` operations set.
464 - ``lru_prio``: Prioritize the region on its LRU lists.
465 Supported by ``paddr`` operations set.
466 - ``lru_deprio``: Deprioritize the region on its LRU lists.
467 Supported by ``paddr`` operations set.
468 - ``migrate_hot``: Migrate the regions prioritizing warmer regions.
469 Supported by ``vaddr``, ``fvaddr`` and ``paddr`` operations set.
470 - ``migrate_cold``: Migrate the regions prioritizing colder regions.
471 Supported by ``vaddr``, ``fvaddr`` and ``paddr`` operations set.
472 - ``stat``: Do nothing but count the statistics.
479 To know how user-space can set the action via :ref:`DAMON sysfs interface
496 To know how user-space can set the access pattern via :ref:`DAMON sysfs
506 DAMOS upper-bound overhead control feature. DAMOS could incur high overhead if
514 To mitigate that situation, DAMOS provides an upper-bound overhead control
515 feature called quotas. It lets users specify an upper limit of time that DAMOS
517 the action can be applied within a user-specified time duration.
519 To know how user-space can set the basic quotas via :ref:`DAMON sysfs interface
535 rarely accessed (colder) memory regions would be prioritized for page-out
538 action are implemented in each DAMON operations set, together with the actions.
540 Though the implementation is up to the DAMON operations set, it would be common
550 To know how user-space can set the prioritization weights via :ref:`DAMON sysfs
557 Aim-oriented Feedback-driven Auto-tuning
560 Automatic feedback-driven quota tuning. Instead of setting the absolute quota
568 ``target_value``, ``current_value`` and ``nid``. The auto-tuning mechanism
572 - ``user_input``: User-provided value. Users could use any metric that they
575 time (PSI) could be examples. Note that users should explicitly set
578 - ``some_mem_psi_us``: System-wide ``some`` memory pressure stall information
581 set by users at the initial time. In other words, DAMOS does self-feedback.
582 - ``node_mem_used_bp``: Specific NUMA node's used memory ratio in bp (1/10,000).
583 - ``node_mem_free_bp``: Specific NUMA node's free memory ratio in bp (1/10,000).
588 To know how user-space can set the tuning goal metric, the target value, and/or
614 To know how user-space can set the watermarks via :ref:`DAMON sysfs interface
624 Non-access pattern-based target memory regions filtering. If users run
625 self-written programs or have good profiling tools, they could know something
629 have a list of latency-critical processes.
632 a feature called DAMOS filters. The feature allows users to set an arbitrary
635 - a type of memory (``type``),
636 - whether it is for the memory of the type or all except the type
638 - whether it is to allow (include) or reject (exclude) applying
639 the scheme's action to the memory (``allow``).
642 core layer, while others are handled by operations set. In the latter case,
643 hence, support of the filter types depends on the DAMON operations set. In
644 case of the core layer-handled filters, the memory regions that excluded by the
646 a memory regions is filtered by an operations set layer-handled filter, it is
662 young or not, since it matches with the first allow-filter. If the page is
664 second reject-filter blocks it. If the page is neither anonymous nor young,
670 - Core layer handled
671 - addr
672 - Applied to pages that belonging to a given address range.
673 - target
674 - Applied to pages that belonging to a given DAMON monitoring target.
675 - Operations layer handled, supported by only ``paddr`` operations set.
676 - anon
677 - Applied to pages that containing data that not stored in files.
678 - active
679 - Applied to active pages.
680 - memcg
681 - Applied to pages that belonging to a given cgroup.
682 - young
683 - Applied to pages that are accessed after the last access check from the
685 - hugepage_size
686 - Applied to pages that managed in a given size range.
687 - unmapped
688 - Applied to pages that unmapped.
690 To know how user-space can set the filters via :ref:`DAMON sysfs interface
705 - ``nr_tried``: Total number of regions that the scheme is tried to be applied.
706 - ``sz_tried``: Total size of regions that the scheme is tried to be applied.
707 - ``sz_ops_filter_passed``: Total bytes that passed operations set
708 layer-handled DAMOS filters.
709 - ``nr_applied``: Total number of regions that the scheme is applied.
710 - ``sz_applied``: Total size of regions that the scheme is applied.
711 - ``qt_exceeds``: Total number of times the quota of the scheme has exceeded.
720 The core logic will only ask the underlying :ref:`operation set
724 "A scheme is applied to a region" means the :ref:`operation set
727 operation set, and the types of the :ref:`action <damon_design_damos_action>`
728 and the pages of the region can affect this. For example, if a filter is set
733 To know how user-space can read the stats via :ref:`DAMON sysfs interface
750 ---------------------------------
752 The programming interface for kernel space data access-aware applications.
755 access-aware applications using DAMON's core features. For this, DAMON exposes
770 for general purpose DAMON control and special purpose data access-aware system
772 user space. The user space can build their efficient data access-aware
777 --------------------------------------
783 'sysfs', allow users to specify their requests to and get the answers from
786 requested via the DAMON API, and return the results to the user-space.
790 user space tools. One such Python-written user space tool is available at
793 (https://packages.fedoraproject.org/pkgs/python-damo/damo/).
800 Special-Purpose Access-aware Kernel Modules
801 -------------------------------------------
806 runtime. For each special-purpose system-wide data access-aware system
809 extended for boot-time and even compile time control. Default values of DAMON
817 (:doc:`/admin-guide/mm/damon/reclaim` and
818 :doc:`/admin-guide/mm/damon/lru_sort`).