Lines Matching +full:memory +full:- +full:region
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
34 - :ref:`Modules <damon_modules>`: Implements kernel modules for various
49 monitoring are address-space dependent.
65 For example, physical memory, virtual memory, swap space, those for specific
66 processes, NUMA nodes, files, and backing memory devices would be supportable.
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 -------------------------------------------
88 and updates the monitoring target address regions so that entire memory
95 Only small parts in the super-huge virtual address space of the processes are
96 mapped to the physical memory and accessed. Thus, tracking the unmapped
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::
113 <BIG UNMAPPED REGION 1>
114 <uppermost mmap()-ed region>
115 (small mmap()-ed regions and munmap()-ed regions)
116 <lowermost mmap()-ed region>
117 <BIG UNMAPPED REGION 2>
121 PTE Accessed-bit Based Access Check
122 -----------------------------------
125 Accessed-bit for basic access checks. Only one difference is the way of
147 ----------
154 To know how user-space can set the attributes via :ref:`DAMON sysfs interface
169 clears the results. This can be described in below simple pseudo-code::
188 Region Based Sampling
192 that assumed to have the same access frequencies into a region. As long as the
193 assumption (pages in a region have the same access frequencies) is kept, only
194 one page in the region is required to be checked. Thus, for each ``sampling
195 interval``, DAMON randomly picks one page in each region, waits for one
197 increases the access frequency counter of the region if so. The counter is
198 called ``nr_accesses`` of the region. Therefore, the monitoring overhead is
200 minimum and the maximum number of regions for the trade-off.
210 fulfill the assumption (pages in same region have similar access frequencies),
213 adaptively merges and splits each region based on their access frequency.
221 threshold until the upper-limit of the number of regions is met, or the
224 aggregated access frequency of each region, it splits each region into two or
225 three regions if the total number of regions will not exceed the user-specified
228 In this way, DAMON provides its best-effort quality and minimal overhead while
229 keeping the bounds users set for their trade-off.
238 access pattern of a region has maintained. That could be used for good
242 yet another counter called ``age`` in each region. For each ``aggregation
243 interval``, DAMON checks if the region's size and access frequency
252 virtual memory could be dynamically mapped and unmapped. Physical memory could
253 be hot-plugged.
256 monitoring operations to check dynamic changes including memory mapping changes
257 and applies it to monitoring operations-related data structures such as the
258 abstracted monitoring target memory area only for each of a user-specified time
261 User-space can get the monitoring results via DAMON sysfs interface and/or
270 -----------------
272 One common purpose of data access monitoring is access-aware system efficiency
275 paging out memory regions that are not accessed for more than two minutes
279 using THP for memory regions that are larger than 2 MiB and showing a high
282 One straightforward approach for such schemes would be profile-guided
284 workloads or the system using DAMON, finding memory regions of special
299 works, DAMON provides a feature called Data Access Monitoring-based Operation
302 the access pattern of interest, and applies the user-desired operation actions
303 to the regions, for every user-specified time interval called
306 To know how user-space can set ``apply_interval`` via :ref:`DAMON sysfs
333 - ``willneed``: Call ``madvise()`` for the region with ``MADV_WILLNEED``.
335 - ``cold``: Call ``madvise()`` for the region with ``MADV_COLD``.
337 - ``pageout``: Reclaim the region.
339 - ``hugepage``: Call ``madvise()`` for the region with ``MADV_HUGEPAGE``.
341 - ``nohugepage``: Call ``madvise()`` for the region with ``MADV_NOHUGEPAGE``.
343 - ``lru_prio``: Prioritize the region on its LRU lists.
345 - ``lru_deprio``: Deprioritize the region on its LRU lists.
347 - ``migrate_hot``: Migrate the regions prioritizing warmer regions.
349 - ``migrate_cold``: Migrate the regions prioritizing colder regions.
351 - ``stat``: Do nothing but count the statistics.
354 Applying the actions except ``stat`` to a region is considered as changing the
355 region's characteristics. Hence, DAMOS resets the age of regions when any such
358 To know how user-space can set the action via :ref:`DAMON sysfs interface
372 region's three properties are in the ranges, DAMOS classifies it as one of the
375 To know how user-space can set the access pattern via :ref:`DAMON sysfs
385 DAMOS upper-bound overhead control feature. DAMOS could incur high overhead if
386 the target access pattern is not properly tuned. For example, if a huge memory
387 region having the access pattern of interest is found, applying the scheme's
388 action to all pages of the huge region could consume unacceptably large system
393 To mitigate that situation, DAMOS provides an upper-bound overhead control
395 can use for applying the action, and/or a maximum bytes of memory regions that
396 the action can be applied within a user-specified time duration.
398 To know how user-space can set the basic quotas via :ref:`DAMON sysfs interface
414 rarely accessed (colder) memory regions would be prioritized for page-out
429 To know how user-space can set the prioritization weights via :ref:`DAMON sysfs
436 Aim-oriented Feedback-driven Auto-tuning
439 Automatic feedback-driven quota tuning. Instead of setting the absolute quota
447 ``target_value``, and ``current_value``. The auto-tuning mechanism tries to
451 - ``user_input``: User-provided value. Users could use any metric that they
453 throughput, system metrics like free memory ratio or memory pressure stall
457 - ``some_mem_psi_us``: System-wide ``some`` memory pressure stall information
460 set by users at the initial time. In other words, DAMOS does self-feedback.
462 To know how user-space can set the tuning goal metric, the target value, and/or
474 memory is guaranteed, running a scheme for proactive reclamation would only
476 need to manually monitor some metrics such as free memory ratio, and turn
488 To know how user-space can set the watermarks via :ref:`DAMON sysfs interface
498 Non-access pattern-based target memory regions filtering. If users run
499 self-written programs or have good profiling tools, they could know something
501 requirements for specific types of memory. For example, some users may know
503 have a list of latency-critical processes.
508 memory, and whether it should exclude the memory of the type (filter-out), or
509 all except the memory of the type (filter-in).
514 case of the core layer-handled filters, the memory regions that excluded by the
515 filter are not counted as the scheme has tried to the region. In contrast, if
516 a memory regions is filtered by an operations set layer-handled filter, it is
521 - anonymous page
522 - Applied to pages that containing data that not stored in files.
523 - Handled by operations set layer. Supported by only ``paddr`` set.
524 - memory cgroup
525 - Applied to pages that belonging to a given cgroup.
526 - Handled by operations set layer. Supported by only ``paddr`` set.
527 - young page
528 - Applied to pages that are accessed after the last access check from the
530 - Handled by operations set layer. Supported by only ``paddr`` set.
531 - address range
532 - Applied to pages that belonging to a given address range.
533 - Handled by the core logic.
534 - DAMON monitoring target
535 - Applied to pages that belonging to a given DAMON monitoring target.
536 - Handled by the core logic.
538 To know how user-space can set the watermarks via :ref:`DAMON sysfs interface
544 ---------------------------------
546 The programming interface for kernel space data access-aware applications.
549 access-aware applications using DAMON's core features. For this, DAMON exposes
564 for general purpose DAMON control and special purpose data access-aware system
566 user space. The user space can build their efficient data access-aware
571 --------------------------------------
578 user-space. Please note that DAMON debugfs interface is currently deprecated.
584 API, and return the results to the user-space.
588 user space tools. One such Python-written user space tool is available at
591 (https://packages.fedoraproject.org/pkgs/python-damo/damo/).
593 Please refer to the ABI :doc:`document </admin-guide/mm/damon/usage>` for
597 Special-Purpose Access-aware Kernel Modules
598 -------------------------------------------
603 in runtime. For each special-purpose system-wide data access-aware system
606 extended for boot-time and even compile time control. Default values of DAMON
614 (:doc:`/admin-guide/mm/damon/reclaim` and
615 :doc:`/admin-guide/mm/damon/lru_sort`).