sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget#/translations/zh_CN/mm/damon/designmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget#/translations/zh_TW/mm/damon/designmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget#/translations/it_IT/mm/damon/designmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget#/translations/ja_JP/mm/damon/designmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget#/translations/ko_KR/mm/damon/designmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget#/translations/sp_SP/mm/damon/designmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh=/var/lib/git/docbuild/linux/Documentation/mm/damon/design.rsthKubhsection)}(hhh](htitle)}(hDesignh]hDesign}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubhtarget)}(h5.. _damon_design_execution_model_and_data_structures:h]h}(h]h ]h"]h$]h&]refid0damon-design-execution-model-and-data-structuresuh1hhKhhhhhhubh)}(hhh](h)}(h#Execution Model and Data Structuresh]h#Execution Model and Data Structures}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh paragraph)}(hX?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.h](hThe monitoring-related information including the monitoring request specification and DAMON-based operation schemes are stored in a data structure called DAMON }(hhhhhNhNubhliteral)}(h ``context``h]hcontext}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubh;. DAMON executes each context with a kernel thread called }(hhhhhNhNubh)}(h ``kdamond``h]hkdamond}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubhN. Multiple kdamonds could run in parallel, for different types of monitoring.}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hTo know how user-space can do the configurations and start/stop DAMON, refer to :ref:`DAMON sysfs interface ` documentation.h](hPTo know how user-space can do the configurations and start/stop DAMON, refer to }(hjhhhNhNubh)}(h.:ref:`DAMON sysfs interface `h]hinline)}(hj(h]hDAMON sysfs interface}(hj,hhhNhNubah}(h]h ](xrefstdstd-refeh"]h$]h&]uh1j*hj&ubah}(h]h ]h"]h$]h&]refdocmm/damon/design refdomainj7reftyperef refexplicitrefwarn reftargetsysfs_interfaceuh1hhhhKhjubh documentation.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h](#execution-model-and-data-structuresheh ]h"](#execution model and data structures0damon_design_execution_model_and_data_structureseh$]h&]uh1hhhhhhhhK expect_referenced_by_name}j[hsexpect_referenced_by_id}hhsubh)}(hhh](h)}(hOverall Architectureh]hOverall Architecture}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbhhhhhKubh)}(h9DAMON subsystem is configured with three layers includingh]h9DAMON subsystem is configured with three layers including}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjbhhubh bullet_list)}(hhh](h list_item)}(h:ref:`Operations Set `: Implements fundamental operations for DAMON that depends on the given monitoring target address-space and available set of software/hardware primitives,h]h)}(h:ref:`Operations Set `: Implements fundamental operations for DAMON that depends on the given monitoring target address-space and available set of software/hardware primitives,h](h)}(h,:ref:`Operations Set `h]j+)}(hjh]hOperations Set}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIdamon_operations_setuh1hhhhKhjubh: Implements fundamental operations for DAMON that depends on the given monitoring target address-space and available set of software/hardware primitives,}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h:ref:`Core `: Implements core logics including monitoring overhead/accuracy control and access-aware system operations on top of the operations set layer, andh]h)}(h:ref:`Core `: Implements core logics including monitoring overhead/accuracy control and access-aware system operations on top of the operations set layer, andh](h)}(h:ref:`Core `h]j+)}(hjh]hCore}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIdamon_core_logicuh1hhhhKhjubh: Implements core logics including monitoring overhead/accuracy control and access-aware system operations on top of the operations set layer, and}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(h:ref:`Modules `: Implements kernel modules for various purposes that provides interfaces for the user space, on top of the core layer. h]h)}(h:ref:`Modules `: Implements kernel modules for various purposes that provides interfaces for the user space, on top of the core layer.h](h)}(h:ref:`Modules `h]j+)}(hjh]hModules}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjI damon_modulesuh1hhhhK"hjubhw: Implements kernel modules for various purposes that provides interfaces for the user space, on top of the core layer.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK"hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]bullet-uh1jhhhKhjbhhubh)}(h.. _damon_operations_set:h]h}(h]h ]h"]h$]h&]hՌdamon-operations-setuh1hhK'hjbhhhhubeh}(h]overall-architectureah ]h"]overall architectureah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hOperations Set Layerh]hOperations Set Layer}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKhhhhhK*ubh)}(h-.. _damon_design_configurable_operations_set:h]h}(h]h ]h"]h$]h&]hՌ(damon-design-configurable-operations-setuh1hhK,hjKhhhhubh)}(hXFor 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.h]hXFor 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.}(hjghhhNhNubah}(h]jfah ]h"](damon_design_configurable_operations_setah$]h&]uh1hhhhK.hjKhhj^}jsj\sj`}jfj\subhenumerated_list)}(hhh](j)}(hLIdentification of the monitoring target address range for the address space.h]h)}(hjh]hLIdentification of the monitoring target address range for the address space.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hj}ubah}(h]h ]h"]h$]h&]uh1jhjzhhhhhNubj)}(h`, refer to :ref:`operations ` file part of the documentation.h](h4To know how user-space can do the configuration via }(hjJhhhNhNubh)}(h.:ref:`DAMON sysfs interface `h]j+)}(hjTh]hDAMON sysfs interface}(hjVhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjRubah}(h]h ]h"]h$]h&]refdocjC refdomainj`reftyperef refexplicitrefwarnjIsysfs_interfaceuh1hhhhKMhjJubh , refer to }(hjJhhhNhNubh)}(h!:ref:`operations `h]j+)}(hjxh]h operations}(hjzhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjvubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjI sysfs_contextuh1hhhhKMhjJubh file part of the documentation.}(hjJhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKMhjKhhubj)}(h4.. _damon_design_vaddr_target_regions_construction: h]h)}(h3.. _damon_design_vaddr_target_regions_construction:h]h}(h]h ]h"]h$]h&]hՌ.damon-design-vaddr-target-regions-constructionuh1hhKRhjubah}(h]h ]h"]h$]h&]uh1jhhhKRhjKhhubh)}(hhh](h)}(h+VMA-based Target Address Range Constructionh]h+VMA-based Target Address Range Construction}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKUubh)}(hA mechanism of ``vaddr`` DAMON operations set that automatically initializes and updates the monitoring target address regions so that entire memory mappings of the target processes can be covered.h](hA mechanism of }(hjhhhNhNubh)}(h ``vaddr``h]hvaddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh DAMON operations set that automatically initializes and updates the monitoring target address regions so that entire memory mappings of the target processes can be covered.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKWhjhhubh)}(hThis mechanism is only for the ``vaddr`` operations set. In cases of ``fvaddr`` and ``paddr`` operation sets, users are asked to manually set the monitoring target address ranges.h](hThis mechanism is only for the }(hjhhhNhNubh)}(h ``vaddr``h]hvaddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh operations set. In cases of }(hjhhhNhNubh)}(h ``fvaddr``h]hfvaddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh and }(hjhhhNhNubh)}(h ``paddr``h]hpaddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhV operation sets, users are asked to manually set the monitoring target address ranges.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK[hjhhubh)}(hX Only small parts in the super-huge virtual address space of the processes are mapped to the physical memory and accessed. Thus, tracking the unmapped address regions is just wasteful. However, because DAMON can deal with some level of noise using the adaptive regions adjustment mechanism, tracking every mapping is not strictly required but could even incur a high overhead in some cases. That said, too huge unmapped areas inside the monitoring target should be removed to not take the time for the adaptive mechanism.h]hX Only small parts in the super-huge virtual address space of the processes are mapped to the physical memory and accessed. Thus, tracking the unmapped address regions is just wasteful. However, because DAMON can deal with some level of noise using the adaptive regions adjustment mechanism, tracking every mapping is not strictly required but could even incur a high overhead in some cases. That said, too huge unmapped areas inside the monitoring target should be removed to not take the time for the adaptive mechanism.}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK_hjhhubh)}(hXWFor the reason, this implementation converts the complex mappings to three distinct regions that cover every mapped area of the address space. The two gaps between the three regions are the two biggest unmapped areas in the given address space. The two biggest unmapped areas would be the gap between the heap and the uppermost mmap()-ed region, and the gap between the lowermost mmap()-ed region and the stack in most of the cases. Because these gaps are exceptionally huge in usual address spaces, excluding these will be sufficient to make a reasonable trade-off. Below shows this in detail::h]hXVFor the reason, this implementation converts the complex mappings to three distinct regions that cover every mapped area of the address space. The two gaps between the three regions are the two biggest unmapped areas in the given address space. The two biggest unmapped areas would be the gap between the heap and the uppermost mmap()-ed region, and the gap between the lowermost mmap()-ed region and the stack in most of the cases. Because these gaps are exceptionally huge in usual address spaces, excluding these will be sufficient to make a reasonable trade-off. Below shows this in detail:}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKghjhhubh literal_block)}(h (small mmap()-ed regions and munmap()-ed regions) h]h (small mmap()-ed regions and munmap()-ed regions) }hjHsbah}(h]h ]h"]h$]h&]hhuh1jFhhhKphjhhubeh}(h](+vma-based-target-address-range-constructionjeh ]h"](+vma-based target address range construction.damon_design_vaddr_target_regions_constructioneh$]h&]uh1hhjKhhhhhKUj^}j\jsj`}jjsubh)}(hhh](h)}(h#PTE Accessed-bit Based Access Checkh]h#PTE Accessed-bit Based Access Check}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjahhhhhKzubh)}(hXBoth of the implementations for physical and virtual address spaces use PTE Accessed-bit for basic access checks. Only one difference is the way of finding the relevant PTE Accessed bit(s) from the address. While the implementation for the virtual address walks the page table for the target task of the address, the implementation for the physical address walks every page table having a mapping to the address. In this way, the implementations find and clear the bit(s) for next sampling target address and checks whether the bit(s) set again after one sampling period. This could disturb other kernel subsystems using the Accessed bits, namely Idle page tracking and the reclaim logic. DAMON does nothing to avoid disturbing Idle page tracking, so handling the interference is the responsibility of sysadmins. However, it solves the conflict with the reclaim logic using ``PG_idle`` and ``PG_young`` page flags, as Idle page tracking does.h](hXpBoth of the implementations for physical and virtual address spaces use PTE Accessed-bit for basic access checks. Only one difference is the way of finding the relevant PTE Accessed bit(s) from the address. While the implementation for the virtual address walks the page table for the target task of the address, the implementation for the physical address walks every page table having a mapping to the address. In this way, the implementations find and clear the bit(s) for next sampling target address and checks whether the bit(s) set again after one sampling period. This could disturb other kernel subsystems using the Accessed bits, namely Idle page tracking and the reclaim logic. DAMON does nothing to avoid disturbing Idle page tracking, so handling the interference is the responsibility of sysadmins. However, it solves the conflict with the reclaim logic using }(hjrhhhNhNubh)}(h ``PG_idle``h]hPG_idle}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjrubh and }(hjrhhhNhNubh)}(h ``PG_young``h]hPG_young}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjrubh( page flags, as Idle page tracking does.}(hjrhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK|hjahhubh)}(h.. _damon_core_logic:h]h}(h]h ]h"]h$]h&]hՌdamon-core-logicuh1hhKhjahhhhubeh}(h]#pte-accessed-bit-based-access-checkah ]h"]#pte accessed-bit based access checkah$]h&]uh1hhjKhhhhhKzubeh}(h](operations-set-layerjBeh ]h"](operations set layerdamon_operations_seteh$]h&]uh1hhhhhhhhK*j^}jj8sj`}jBj8subh)}(hhh](h)}(h Core Logicsh]h Core Logics}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h.. _damon_design_monitoring:h]h}(h]h ]h"]h$]h&]hՌdamon-design-monitoringuh1hhKhjhhhhubh)}(hhh](h)}(h Monitoringh]h Monitoring}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hBelow four sections describe each of the DAMON core mechanisms and the five monitoring attributes, ``sampling interval``, ``aggregation interval``, ``update interval``, ``minimum number of regions``, and ``maximum number of regions``.h](hcBelow four sections describe each of the DAMON core mechanisms and the five monitoring attributes, }(hjhhhNhNubh)}(h``sampling interval``h]hsampling interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }(hjhhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }(hjhhhNhNubh)}(h``update interval``h]hupdate interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, }hjsbh)}(h``minimum number of regions``h]hminimum number of regions}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, and }(hjhhhNhNubh)}(h``maximum number of regions``h]hmaximum number of regions}(hj?hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hTo know how user-space can set the attributes via :ref:`DAMON sysfs interface `, refer to :ref:`monitoring_attrs ` part of the documentation.h](h2To know how user-space can set the attributes via }(hjWhhhNhNubh)}(h.:ref:`DAMON sysfs interface `h]j+)}(hjah]hDAMON sysfs interface}(hjchhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj_ubah}(h]h ]h"]h$]h&]refdocjC refdomainjmreftyperef refexplicitrefwarnjIsysfs_interfaceuh1hhhhKhjWubh , refer to }(hjWhhhNhNubh)}(h0:ref:`monitoring_attrs `h]j+)}(hjh]hmonitoring_attrs}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIsysfs_monitoring_attrsuh1hhhhKhjWubh part of the documentation.}(hjWhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hhh](h)}(hAccess Frequency Monitoringh]hAccess Frequency Monitoring}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hX^The output of DAMON says what pages are how frequently accessed for a given duration. The resolution of the access frequency is controlled by setting ``sampling interval`` and ``aggregation interval``. In detail, DAMON checks access to each page per ``sampling interval`` and aggregates the results. In other words, counts the number of the accesses to each page. After each ``aggregation interval`` passes, DAMON calls callback functions that previously registered by users so that users can read the aggregated results and then clears the results. This can be described in below simple pseudo-code::h](hThe output of DAMON says what pages are how frequently accessed for a given duration. The resolution of the access frequency is controlled by setting }(hjhhhNhNubh)}(h``sampling interval``h]hsampling interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh and }(hjhhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh3. In detail, DAMON checks access to each page per }(hjhhhNhNubh)}(h``sampling interval``h]hsampling interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhj and aggregates the results. In other words, counts the number of the accesses to each page. After each }(hjhhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh passes, DAMON calls callback functions that previously registered by users so that users can read the aggregated results and then clears the results. This can be described in below simple pseudo-code:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjG)}(hXnwhile monitoring_on: for page in monitoring_target: if accessed(page): nr_accesses[page] += 1 if time() % aggregation_interval == 0: for callback in user_registered_callbacks: callback(monitoring_target, nr_accesses) for page in monitoring_target: nr_accesses[page] = 0 sleep(sampling interval)h]hXnwhile monitoring_on: for page in monitoring_target: if accessed(page): nr_accesses[page] += 1 if time() % aggregation_interval == 0: for callback in user_registered_callbacks: callback(monitoring_target, nr_accesses) for page in monitoring_target: nr_accesses[page] = 0 sleep(sampling interval)}hjsbah}(h]h ]h"]h$]h&]hhuh1jFhhhKhjhhubh)}(hmThe monitoring overhead of this mechanism will arbitrarily increase as the size of the target workload grows.h]hmThe monitoring overhead of this mechanism will arbitrarily increase as the size of the target workload grows.}(hj"hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h'.. _damon_design_region_based_sampling:h]h}(h]h ]h"]h$]h&]hՌ"damon-design-region-based-samplinguh1hhKhjhhhhubeh}(h]access-frequency-monitoringah ]h"]access frequency monitoringah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(hRegion Based Samplingh]hRegion Based Sampling}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjChhhhhKubh)}(hXTo avoid the unbounded increase of the overhead, DAMON groups adjacent pages that assumed to have the same access frequencies into a region. As long as the assumption (pages in a region have the same access frequencies) is kept, only one page in the region is required to be checked. Thus, for each ``sampling interval``, DAMON randomly picks one page in each region, waits for one ``sampling interval``, checks whether the page is accessed meanwhile, and increases the access frequency counter of the region if so. The counter is called ``nr_accesses`` of the region. Therefore, the monitoring overhead is controllable by setting the number of regions. DAMON allows users to set the minimum and the maximum number of regions for the trade-off.h](hX-To avoid the unbounded increase of the overhead, DAMON groups adjacent pages that assumed to have the same access frequencies into a region. As long as the assumption (pages in a region have the same access frequencies) is kept, only one page in the region is required to be checked. Thus, for each }(hjThhhNhNubh)}(h``sampling interval``h]hsampling interval}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjTubh>, DAMON randomly picks one page in each region, waits for one }(hjThhhNhNubh)}(h``sampling interval``h]hsampling interval}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjTubh, checks whether the page is accessed meanwhile, and increases the access frequency counter of the region if so. The counter is called }(hjThhhNhNubh)}(h``nr_accesses``h]h nr_accesses}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjTubh of the region. Therefore, the monitoring overhead is controllable by setting the number of regions. DAMON allows users to set the minimum and the maximum number of regions for the trade-off.}(hjThhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjChhubh)}(hdThis scheme, however, cannot preserve the quality of the output if the assumption is not guaranteed.h]hdThis scheme, however, cannot preserve the quality of the output if the assumption is not guaranteed.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjChhubh)}(h-.. _damon_design_adaptive_regions_adjustment:h]h}(h]h ]h"]h$]h&]hՌ(damon-design-adaptive-regions-adjustmentuh1hhKhjChhhhubeh}(h](region-based-samplingj:eh ]h"](region based sampling"damon_design_region_based_samplingeh$]h&]uh1hhjhhhhhKj^}jj0sj`}j:j0subh)}(hhh](h)}(hAdaptive Regions Adjustmenth]hAdaptive Regions Adjustment}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXwEven somehow the initial monitoring target regions are well constructed to fulfill the assumption (pages in same region have similar access frequencies), the data access pattern can be dynamically changed. This will result in low monitoring quality. To keep the assumption as much as possible, DAMON adaptively merges and splits each region based on their access frequency.h]hXwEven somehow the initial monitoring target regions are well constructed to fulfill the assumption (pages in same region have similar access frequencies), the data access pattern can be dynamically changed. This will result in low monitoring quality. To keep the assumption as much as possible, DAMON adaptively merges and splits each region based on their access frequency.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXvFor each ``aggregation interval``, it compares the access frequencies (``nr_accesses``) of adjacent regions. If the difference is small, and if the sum of the two regions' sizes is smaller than the size of total regions divided by the ``minimum number of regions``, DAMON merges the two regions. If the resulting number of total regions is still higher than ``maximum number of regions``, it repeats the merging with increasing access frequenceis difference threshold until the upper-limit of the number of regions is met, or the threshold becomes higher than possible maximum value (``aggregation interval`` divided by ``sampling interval``). Then, after it reports and clears the aggregated access frequency of each region, it splits each region into two or three regions if the total number of regions will not exceed the user-specified maximum number of regions after the split.h](h For each }(hjhhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh&, it compares the access frequencies (}(hjhhhNhNubh)}(h``nr_accesses``h]h nr_accesses}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh) of adjacent regions. If the difference is small, and if the sum of the two regions’ sizes is smaller than the size of total regions divided by the }(hjhhhNhNubh)}(h``minimum number of regions``h]hminimum number of regions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh_, DAMON merges the two regions. If the resulting number of total regions is still higher than }(hjhhhNhNubh)}(h``maximum number of regions``h]hmaximum number of regions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh, it repeats the merging with increasing access frequenceis difference threshold until the upper-limit of the number of regions is met, or the threshold becomes higher than possible maximum value (}(hjhhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh divided by }(hjhhhNhNubh)}(h``sampling interval``h]hsampling interval}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh). Then, after it reports and clears the aggregated access frequency of each region, it splits each region into two or three regions if the total number of regions will not exceed the user-specified maximum number of regions after the split.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hIn this way, DAMON provides its best-effort quality and minimal overhead while keeping the bounds users set for their trade-off.h]hIn this way, DAMON provides its best-effort quality and minimal overhead while keeping the bounds users set for their trade-off.}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h.. _damon_design_age_tracking:h]h}(h]h ]h"]h$]h&]hՌdamon-design-age-trackinguh1hhKhjhhhhubeh}(h](adaptive-regions-adjustmentjeh ]h"](adaptive regions adjustment(damon_design_adaptive_regions_adjustmenteh$]h&]uh1hhjhhhhhKj^}jtjsj`}jjsubh)}(hhh](h)}(h Age Trackingh]h Age Tracking}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjyhhhhhKubh)}(hXBy analyzing the monitoring results, users can also find how long the current access pattern of a region has maintained. That could be used for good understanding of the access pattern. For example, page placement algorithm utilizing both the frequency and the recency could be implemented using that. To make such access pattern maintained period analysis easier, DAMON maintains yet another counter called ``age`` in each region. For each ``aggregation interval``, DAMON checks if the region's size and access frequency (``nr_accesses``) has significantly changed. If so, the counter is reset to zero. Otherwise, the counter is increased.h](hXBy analyzing the monitoring results, users can also find how long the current access pattern of a region has maintained. That could be used for good understanding of the access pattern. For example, page placement algorithm utilizing both the frequency and the recency could be implemented using that. To make such access pattern maintained period analysis easier, DAMON maintains yet another counter called }(hjhhhNhNubh)}(h``age``h]hage}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh in each region. For each }(hjhhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh<, DAMON checks if the region’s size and access frequency (}(hjhhhNhNubh)}(h``nr_accesses``h]h nr_accesses}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhh) has significantly changed. If so, the counter is reset to zero. Otherwise, the counter is increased.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjyhhubeh}(h]( age-trackingjmeh ]h"]( age trackingdamon_design_age_trackingeh$]h&]uh1hhjhhhhhKj^}jjcsj`}jmjcsubh)}(hhh](h)}(h%Dynamic Target Space Updates Handlingh]h%Dynamic Target Space Updates Handling}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hThe monitoring target address range could dynamically changed. For example, virtual memory could be dynamically mapped and unmapped. Physical memory could be hot-plugged.h]hThe monitoring target address range could dynamically changed. For example, virtual memory could be dynamically mapped and unmapped. Physical memory could be hot-plugged.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXRAs the changes could be quite frequent in some cases, DAMON allows the monitoring operations to check dynamic changes including memory mapping changes and applies it to monitoring operations-related data structures such as the abstracted monitoring target memory area only for each of a user-specified time interval (``update interval``).h](hX=As the changes could be quite frequent in some cases, DAMON allows the monitoring operations to check dynamic changes including memory mapping changes and applies it to monitoring operations-related data structures such as the abstracted monitoring target memory area only for each of a user-specified time interval (}(hjhhhNhNubh)}(h``update interval``h]hupdate interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hUser-space can get the monitoring results via DAMON sysfs interface and/or tracepoints. For more details, please refer to the documentations for :ref:`DAMOS tried regions ` and :ref:`tracepoint`, respectively.h](hUser-space can get the monitoring results via DAMON sysfs interface and/or tracepoints. For more details, please refer to the documentations for }(hjhhhNhNubh)}(h8:ref:`DAMOS tried regions `h]j+)}(hj"h]hDAMOS tried regions}(hj$hhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj ubah}(h]h ]h"]h$]h&]refdocjC refdomainj.reftyperef refexplicitrefwarnjIsysfs_schemes_tried_regionsuh1hhhhMhjubh and }(hjhhhNhNubh)}(h:ref:`tracepoint`h]j+)}(hjFh]h tracepoint}(hjHhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjDubah}(h]h ]h"]h$]h&]refdocjC refdomainjRreftyperef refexplicitrefwarnjI tracepointuh1hhhhMhjubh, respectively.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h0.. _damon_design_monitoring_params_tuning_guide:h]h}(h]h ]h"]h$]h&]hՌ+damon-design-monitoring-params-tuning-guideuh1hhM hjhhhhubeh}(h]%dynamic-target-space-updates-handlingah ]h"]%dynamic target space updates handlingah$]h&]uh1hhjhhhhhKubh)}(hhh](h)}(h"Monitoring Parameters Tuning Guideh]h"Monitoring Parameters Tuning Guide}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hXIn short, set ``aggregation interval`` to capture meaningful amount of accesses for the purpose. The amount of accesses can be measured using ``nr_accesses`` and ``age`` of regions in the aggregated monitoring results snapshot. The default value of the interval, ``100ms``, turns out to be too short in many cases. Set ``sampling interval`` proportional to ``aggregation interval``. By default, ``1/20`` is recommended as the ratio.h](hIn short, set }(hjhhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhi to capture meaningful amount of accesses for the purpose. The amount of accesses can be measured using }(hjhhhNhNubh)}(h``nr_accesses``h]h nr_accesses}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh and }(hjhhhNhNubh)}(h``age``h]hage}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh_ of regions in the aggregated monitoring results snapshot. The default value of the interval, }(hjhhhNhNubh)}(h ``100ms``h]h100ms}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh0, turns out to be too short in many cases. Set }(hjhhhNhNubh)}(h``sampling interval``h]hsampling interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh proportional to }(hjhhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh. By default, }(hjhhhNhNubh)}(h``1/20``h]h1/20}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh is recommended as the ratio.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXg``Aggregation interval`` should be set as the time interval that the workload can make an amount of accesses for the monitoring purpose, within the interval. If the interval is too short, only small number of accesses are captured. As a result, the monitoring results look everything is samely accessed only rarely. For many purposes, that would be useless. If it is too long, however, the time to converge regions with the :ref:`regions adjustment mechanism ` can be too long, depending on the time scale of the given purpose. This could happen if the workload is actually making only rare accesses but the user thinks the amount of accesses for the monitoring purpose too high. For such cases, the target amount of access to capture per ``aggregation interval`` should carefully reconsidered. Also, note that the captured amount of accesses is represented with not only ``nr_accesses``, but also ``age``. For example, even if every region on the monitoring results show zero ``nr_accesses``, regions could still be distinguished using ``age`` values as the recency information.h](h)}(h``Aggregation interval``h]hAggregation interval}(hj" hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhX should be set as the time interval that the workload can make an amount of accesses for the monitoring purpose, within the interval. If the interval is too short, only small number of accesses are captured. As a result, the monitoring results look everything is samely accessed only rarely. For many purposes, that would be useless. If it is too long, however, the time to converge regions with the }(hj hhhNhNubh)}(hN:ref:`regions adjustment mechanism `h]j+)}(hj6 h]hregions adjustment mechanism}(hj8 hhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj4 ubah}(h]h ]h"]h$]h&]refdocjC refdomainjB reftyperef refexplicitrefwarnjI(damon_design_adaptive_regions_adjustmentuh1hhhhMhj ubhX can be too long, depending on the time scale of the given purpose. This could happen if the workload is actually making only rare accesses but the user thinks the amount of accesses for the monitoring purpose too high. For such cases, the target amount of access to capture per }(hj hhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hjX hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhn should carefully reconsidered. Also, note that the captured amount of accesses is represented with not only }(hj hhhNhNubh)}(h``nr_accesses``h]h nr_accesses}(hjj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh , but also }(hj hhhNhNubh)}(h``age``h]hage}(hj| hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhI. For example, even if every region on the monitoring results show zero }(hj hhhNhNubh)}(h``nr_accesses``h]h nr_accesses}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh-, regions could still be distinguished using }(hj hhhNhNubh)}(h``age``h]hage}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh# values as the recency information.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hHence the optimum value of ``aggregation interval`` depends on the access intensiveness of the workload. The user should tune the interval based on the amount of access that captured on each aggregated snapshot of the monitoring results.h](hHence the optimum value of }(hj hhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh depends on the access intensiveness of the workload. The user should tune the interval based on the amount of access that captured on each aggregated snapshot of the monitoring results.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM)hjhhubh)}(hNote that the default value of the interval is 100 milliseconds, which is too short in many cases, especially on large systems.h]hNote that the default value of the interval is 100 milliseconds, which is too short in many cases, especially on large systems.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM.hjhhubh)}(hX``Sampling interval`` defines the resolution of each aggregation. If it is set too large, monitoring results will look like every region was samely rarely accessed, or samely frequently accessed. That is, regions become undistinguishable based on access pattern, and therefore the results will be useless in many use cases. If ``sampling interval`` is too small, it will not degrade the resolution, but will increase the monitoring overhead. If it is appropriate enough to provide a resolution of the monitoring results that sufficient for the given purpose, it shouldn't be unnecessarily further lowered. It is recommended to be set proportional to ``aggregation interval``. By default, the ratio is set as ``1/20``, and it is still recommended.h](h)}(h``Sampling interval``h]hSampling interval}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhX5 defines the resolution of each aggregation. If it is set too large, monitoring results will look like every region was samely rarely accessed, or samely frequently accessed. That is, regions become undistinguishable based on access pattern, and therefore the results will be useless in many use cases. If }(hj hhhNhNubh)}(h``sampling interval``h]hsampling interval}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhX2 is too small, it will not degrade the resolution, but will increase the monitoring overhead. If it is appropriate enough to provide a resolution of the monitoring results that sufficient for the given purpose, it shouldn’t be unnecessarily further lowered. It is recommended to be set proportional to }(hj hhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh". By default, the ratio is set as }(hj hhhNhNubh)}(h``1/20``h]h1/20}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh, and it is still recommended.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM1hjhhubh)}(hBased on the manual tuning guide, DAMON provides more intuitive knob-based intervals auto tuning mechanism. Please refer to :ref:`the design document of the feature ` for detail.h](h}Based on the manual tuning guide, DAMON provides more intuitive knob-based intervals auto tuning mechanism. Please refer to }(hj8 hhhNhNubh)}(hX:ref:`the design document of the feature `h]j+)}(hjB h]h"the design document of the feature}(hjD hhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj@ ubah}(h]h ]h"]h$]h&]refdocjC refdomainjN reftyperef refexplicitrefwarnjI,damon_design_monitoring_intervals_autotuninguh1hhhhM<hj8 ubh for detail.}(hj8 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM<hjhhubh)}(hHRefer to below documents for an example tuning based on the above guide.h]hHRefer to below documents for an example tuning based on the above guide.}(hjj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM@hjhhubhcompound)}(hhh]htoctree)}(hhh]h}(h]h ]h"]h$]h&]hjCentries]N,mm/damon/monitoring_intervals_tuning_examplea includefiles]j amaxdepthKcaptionNglobhidden includehiddennumberedK titlesonly rawentries]uh1j} hhhMBhjz ubah}(h]h ]toctree-wrapperah"]h$]h&]uh1jx hjhhhhhNubh)}(h1.. _damon_design_monitoring_intervals_autotuning:h]h}(h]h ]h"]h$]h&]hՌ,damon-design-monitoring-intervals-autotuninguh1hhMHhjhhhhubeh}(h]("monitoring-parameters-tuning-guidejxeh ]h"]("monitoring parameters tuning guide+damon_design_monitoring_params_tuning_guideeh$]h&]uh1hhjhhhhhMj^}j jnsj`}jxjnsubh)}(hhh](h)}(h Monitoring Intervals Auto-tuningh]h Monitoring Intervals Auto-tuning}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hhhhhMKubh)}(hXDAMON provides automatic tuning of the ``sampling interval`` and ``aggregation interval`` based on the :ref:`the tuning guide idea `. The tuning mechanism allows users to set the aimed amount of access events to observe via DAMON within given time interval. The target can be specified by the user as a ratio of DAMON-observed access events to the theoretical maximum amount of the events (``access_bp``) that measured within a given number of aggregations (``aggrs``).h](h'DAMON provides automatic tuning of the }(hj hhhNhNubh)}(h``sampling interval``h]hsampling interval}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh and }(hj hhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh based on the }(hj hhhNhNubh)}(hJ:ref:`the tuning guide idea `h]j+)}(hj h]hthe tuning guide idea}(hj hhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj ubah}(h]h ]h"]h$]h&]refdocjC refdomainj reftyperef refexplicitrefwarnjI+damon_design_monitoring_params_tuning_guideuh1hhhhMMhj ubhX. The tuning mechanism allows users to set the aimed amount of access events to observe via DAMON within given time interval. The target can be specified by the user as a ratio of DAMON-observed access events to the theoretical maximum amount of the events (}(hj hhhNhNubh)}(h ``access_bp``h]h access_bp}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh7) that measured within a given number of aggregations (}(hj hhhNhNubh)}(h ``aggrs``h]haggrs}(hj' hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh).}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMMhj hhubh)}(hXThe DAMON-observed access events are calculated in byte granularity based on DAMON :ref:`region assumption `. For example, if a region of size ``X`` bytes of ``Y`` ``nr_accesses`` is found, it means ``X * Y`` access events are observed by DAMON. Theoretical maximum access events for the region is calculated in same way, but replacing ``Y`` with theoretical maximum ``nr_accesses``, which can be calculated as ``aggregation interval / sampling interval``.h](hSThe DAMON-observed access events are calculated in byte granularity based on DAMON }(hj? hhhNhNubh)}(h=:ref:`region assumption `h]j+)}(hjI h]hregion assumption}(hjK hhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjG ubah}(h]h ]h"]h$]h&]refdocjC refdomainjU reftyperef refexplicitrefwarnjI"damon_design_region_based_samplinguh1hhhhMVhj? ubh$. For example, if a region of size }(hj? hhhNhNubh)}(h``X``h]hX}(hjk hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj? ubh bytes of }(hj? hhhNhNubh)}(h``Y``h]hY}(hj} hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj? ubh }(hj? hhhNhNubh)}(h``nr_accesses``h]h nr_accesses}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj? ubh is found, it means }(hj? hhhNhNubh)}(h ``X * Y``h]hX * Y}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj? ubh access events are observed by DAMON. Theoretical maximum access events for the region is calculated in same way, but replacing }(hj? hhhNhNubh)}(h``Y``h]hY}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj? ubh with theoretical maximum }(hj? hhhNhNubh)}(h``nr_accesses``h]h nr_accesses}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj? ubh, which can be calculated as }(hj? hhhNhNubh)}(h,``aggregation interval / sampling interval``h]h(aggregation interval / sampling interval}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj? ubh.}(hj? hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMVhj hhubh)}(hXThe mechanism calculates the ratio of access events for ``aggrs`` aggregations, and increases or decrease the ``sampleing interval`` and ``aggregation interval`` in same ratio, if the observed access ratio is lower or higher than the target, respectively. The ratio of the intervals change is decided in proportion to the distance between current samples ratio and the target ratio.h](h8The mechanism calculates the ratio of access events for }(hj hhhNhNubh)}(h ``aggrs``h]haggrs}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh- aggregations, and increases or decrease the }(hj hhhNhNubh)}(h``sampleing interval``h]hsampleing interval}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh and }(hj hhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh in same ratio, if the observed access ratio is lower or higher than the target, respectively. The ratio of the intervals change is decided in proportion to the distance between current samples ratio and the target ratio.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM^hj hhubh)}(hXThe user can further set the minimum and maximum ``sampling interval`` that can be set by the tuning mechanism using two parameters (``min_sample_us`` and ``max_sample_us``). Because the tuning mechanism changes ``sampling interval`` and ``aggregation interval`` in same ratio always, the minimum and maximum ``aggregation interval`` after each of the tuning changes can automatically set together.h](h1The user can further set the minimum and maximum }(hj3 hhhNhNubh)}(h``sampling interval``h]hsampling interval}(hj; hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3 ubh? that can be set by the tuning mechanism using two parameters (}(hj3 hhhNhNubh)}(h``min_sample_us``h]h min_sample_us}(hjM hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3 ubh and }(hj3 hhhNhNubh)}(h``max_sample_us``h]h max_sample_us}(hj_ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3 ubh)). Because the tuning mechanism changes }(hj3 hhhNhNubh)}(h``sampling interval``h]hsampling interval}(hjq hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3 ubh and }(hj3 hhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3 ubh/ in same ratio always, the minimum and maximum }(hj3 hhhNhNubh)}(h``aggregation interval``h]haggregation interval}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj3 ubhA after each of the tuning changes can automatically set together.}(hj3 hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMdhj hhubh)}(hX|The tuning is turned off by default, and need to be set explicitly by the user. As a rule of thumbs and the Parreto principle, 4% access samples ratio target is recommended. Note that Parreto principle (80/20 rule) has applied twice. That is, assumes 4% (20% of 20%) DAMON-observed access events ratio (source) to capture 64% (80% multipled by 80%) real access events (outcomes).h]hX|The tuning is turned off by default, and need to be set explicitly by the user. As a rule of thumbs and the Parreto principle, 4% access samples ratio target is recommended. Note that Parreto principle (80/20 rule) has applied twice. That is, assumes 4% (20% of 20%) DAMON-observed access events ratio (source) to capture 64% (80% multipled by 80%) real access events (outcomes).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMkhj hhubh)}(hTo know how user-space can use this feature via :ref:`DAMON sysfs interface `, refer to :ref:`intervals_goal ` part of the documentation.h](h0To know how user-space can use this feature via }(hj hhhNhNubh)}(h.:ref:`DAMON sysfs interface `h]j+)}(hj h]hDAMON sysfs interface}(hj hhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj ubah}(h]h ]h"]h$]h&]refdocjC refdomainj reftyperef refexplicitrefwarnjIsysfs_interfaceuh1hhhhMqhj ubh , refer to }(hj hhhNhNubh)}(h$:ref:`intervals_goal `h]j+)}(hj h]hintervals_goal}(hj hhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj ubah}(h]h ]h"]h$]h&]refdocjC refdomainj reftyperef refexplicitrefwarnjI sysfs_schemeuh1hhhhMqhj ubh part of the documentation.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMqhj hhubh)}(h.. _damon_design_damos:h]h}(h]h ]h"]h$]h&]hՌdamon-design-damosuh1hhMvhj hhhhubeh}(h]( monitoring-intervals-auto-tuningj eh ]h"]( monitoring intervals auto-tuning,damon_design_monitoring_intervals_autotuningeh$]h&]uh1hhjhhhhhMKj^}j" j sj`}j j subeh}(h]( monitoringjeh ]h"]( monitoringdamon_design_monitoringeh$]h&]uh1hhjhhhhhKj^}j- jsj`}jjsubh)}(hhh](h)}(hOperation Schemesh]hOperation Schemes}(hj5 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2 hhhhhMyubh)}(hkOne common purpose of data access monitoring is access-aware system efficiency optimizations. For example,h]hkOne common purpose of data access monitoring is access-aware system efficiency optimizations. For example,}(hjC hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM{hj2 hhubj)}(hJpaging out memory regions that are not accessed for more than two minutes h]h)}(hIpaging out memory regions that are not accessed for more than two minutesh]hIpaging out memory regions that are not accessed for more than two minutes}(hjU hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM~hjQ ubah}(h]h ]h"]h$]h&]uh1jhhhM~hj2 hhubh)}(horh]hor}(hji hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj2 hhubj)}(hvusing THP for memory regions that are larger than 2 MiB and showing a high access frequency for more than one minute. h]h)}(huusing THP for memory regions that are larger than 2 MiB and showing a high access frequency for more than one minute.h]huusing THP for memory regions that are larger than 2 MiB and showing a high access frequency for more than one minute.}(hj{ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjw ubah}(h]h ]h"]h$]h&]uh1jhhhMhj2 hhubh)}(hXOne straightforward approach for such schemes would be profile-guided optimizations. That is, getting data access monitoring results of the workloads or the system using DAMON, finding memory regions of special characteristics by profiling the monitoring results, and making system operation changes for the regions. The changes could be made by modifying or providing advice to the software (the application and/or the kernel), or reconfiguring the hardware. Both offline and online approaches could be available.h]hXOne straightforward approach for such schemes would be profile-guided optimizations. That is, getting data access monitoring results of the workloads or the system using DAMON, finding memory regions of special characteristics by profiling the monitoring results, and making system operation changes for the regions. The changes could be made by modifying or providing advice to the software (the application and/or the kernel), or reconfiguring the hardware. Both offline and online approaches could be available.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj2 hhubh)}(hXAmong those, providing advice to the kernel at runtime would be flexible and effective, and therefore widely be used. However, implementing such schemes could impose unnecessary redundancy and inefficiency. The profiling could be redundant if the type of interest is common. Exchanging the information including monitoring results and operation advice between kernel and user spaces could be inefficient.h]hXAmong those, providing advice to the kernel at runtime would be flexible and effective, and therefore widely be used. However, implementing such schemes could impose unnecessary redundancy and inefficiency. The profiling could be redundant if the type of interest is common. Exchanging the information including monitoring results and operation advice between kernel and user spaces could be inefficient.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj2 hhubh)}(hXTo allow users to reduce such redundancy and inefficiencies by offloading the works, DAMON provides a feature called Data Access Monitoring-based Operation Schemes (DAMOS). It lets users specify their desired schemes at a high level. For such specifications, DAMON starts monitoring, finds regions having the access pattern of interest, and applies the user-desired operation actions to the regions, for every user-specified time interval called ``apply_interval``. h](hXTo allow users to reduce such redundancy and inefficiencies by offloading the works, DAMON provides a feature called Data Access Monitoring-based Operation Schemes (DAMOS). It lets users specify their desired schemes at a high level. For such specifications, DAMON starts monitoring, finds regions having the access pattern of interest, and applies the user-desired operation actions to the regions, for every user-specified time interval called }(hj hhhNhNubh)}(h``apply_interval``h]happly_interval}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj2 hhubh)}(hTo know how user-space can set ``apply_interval`` via :ref:`DAMON sysfs interface `, refer to :ref:`apply_interval_us ` part of the documentation.h](hTo know how user-space can set }(hj hhhNhNubh)}(h``apply_interval``h]happly_interval}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh via }(hj hhhNhNubh)}(h.:ref:`DAMON sysfs interface `h]j+)}(hj h]hDAMON sysfs interface}(hj hhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj ubah}(h]h ]h"]h$]h&]refdocjC refdomainj reftyperef refexplicitrefwarnjIsysfs_interfaceuh1hhhhMhj ubh , refer to }(hj hhhNhNubh)}(h':ref:`apply_interval_us `h]j+)}(hj h]happly_interval_us}(hj hhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj ubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjI sysfs_schemeuh1hhhhMhj ubh part of the documentation.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj2 hhubh)}(h.. _damon_design_damos_action:h]h}(h]h ]h"]h$]h&]hՌdamon-design-damos-actionuh1hhMhj2 hhhhubh)}(hhh](h)}(hOperation Actionh]hOperation Action}(hjAhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj>hhhhhMubh)}(hX The management action that the users desire to apply to the regions of their interest. For example, paging out, prioritizing for next reclamation victim selection, advising ``khugepaged`` to collapse or split, or doing nothing but collecting statistics of the regions.h](hThe management action that the users desire to apply to the regions of their interest. For example, paging out, prioritizing for next reclamation victim selection, advising }(hjOhhhNhNubh)}(h``khugepaged``h]h khugepaged}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjOubhQ to collapse or split, or doing nothing but collecting statistics of the regions.}(hjOhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj>hhubh)}(hX+The list of supported actions is defined in DAMOS, but the implementation of each action is in the DAMON operations set layer because the implementation normally depends on the monitoring target address space. For example, the code for paging specific virtual address ranges out would be different from that for physical address ranges. And the monitoring operations implementation sets are 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 together.h]hX+The list of supported actions is defined in DAMOS, but the implementation of each action is in the DAMON operations set layer because the implementation normally depends on the monitoring target address space. For example, the code for paging specific virtual address ranges out would be different from that for physical address ranges. And the monitoring operations implementation sets are 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 together.}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj>hhubh)}(hsThe list of the supported actions, their meaning, and DAMON operations sets that supports each action are as below.h]hsThe list of the supported actions, their meaning, and DAMON operations sets that supports each action are as below.}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj>hhubj)}(hX`- ``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``: Reclaim the region. 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. - ``migrate_hot``: Migrate the regions prioritizing warmer regions. Supported by ``paddr`` operations set. - ``migrate_cold``: Migrate the regions prioritizing colder regions. Supported by ``paddr`` operations set. - ``stat``: Do nothing but count the statistics. Supported by all operations sets. h]j)}(hhh](j)}(h}``willneed``: Call ``madvise()`` for the region with ``MADV_WILLNEED``. Supported by ``vaddr`` and ``fvaddr`` operations set.h]h)}(h}``willneed``: Call ``madvise()`` for the region with ``MADV_WILLNEED``. Supported by ``vaddr`` and ``fvaddr`` operations set.h](h)}(h ``willneed``h]hwillneed}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh: Call }(hjhhhNhNubh)}(h ``madvise()``h]h madvise()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh for the region with }(hjhhhNhNubh)}(h``MADV_WILLNEED``h]h MADV_WILLNEED}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh. Supported by }(hjhhhNhNubh)}(h ``vaddr``h]hvaddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh and }(hjhhhNhNubh)}(h ``fvaddr``h]hfvaddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh operations set.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hu``cold``: Call ``madvise()`` for the region with ``MADV_COLD``. Supported by ``vaddr`` and ``fvaddr`` operations set.h]h)}(hu``cold``: Call ``madvise()`` for the region with ``MADV_COLD``. Supported by ``vaddr`` and ``fvaddr`` operations set.h](h)}(h``cold``h]hcold}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh: Call }(hjhhhNhNubh)}(h ``madvise()``h]h madvise()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh for the region with }(hjhhhNhNubh)}(h ``MADV_COLD``h]h MADV_COLD}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh. Supported by }(hjhhhNhNubh)}(h ``vaddr``h]hvaddr}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh and }(hjhhhNhNubh)}(h ``fvaddr``h]hfvaddr}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh operations set.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(ha``pageout``: Reclaim the region. Supported by ``vaddr``, ``fvaddr`` and ``paddr`` operations set.h]h)}(ha``pageout``: Reclaim the region. Supported by ``vaddr``, ``fvaddr`` and ``paddr`` operations set.h](h)}(h ``pageout``h]hpageout}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjrubh#: Reclaim the region. Supported by }(hjrhhhNhNubh)}(h ``vaddr``h]hvaddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjrubh, }(hjrhhhNhNubh)}(h ``fvaddr``h]hfvaddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjrubh and }(hjrhhhNhNubh)}(h ``paddr``h]hpaddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjrubh operations set.}(hjrhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjnubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h}``hugepage``: Call ``madvise()`` for the region with ``MADV_HUGEPAGE``. Supported by ``vaddr`` and ``fvaddr`` operations set.h]h)}(h}``hugepage``: Call ``madvise()`` for the region with ``MADV_HUGEPAGE``. Supported by ``vaddr`` and ``fvaddr`` operations set.h](h)}(h ``hugepage``h]hhugepage}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh: Call }(hjhhhNhNubh)}(h ``madvise()``h]h madvise()}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh for the region with }(hjhhhNhNubh)}(h``MADV_HUGEPAGE``h]h MADV_HUGEPAGE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh. Supported by }(hjhhhNhNubh)}(h ``vaddr``h]hvaddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh and }(hjhhhNhNubh)}(h ``fvaddr``h]hfvaddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh operations set.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h``nohugepage``: Call ``madvise()`` for the region with ``MADV_NOHUGEPAGE``. Supported by ``vaddr`` and ``fvaddr`` operations set.h]h)}(h``nohugepage``: Call ``madvise()`` for the region with ``MADV_NOHUGEPAGE``. Supported by ``vaddr`` and ``fvaddr`` operations set.h](h)}(h``nohugepage``h]h nohugepage}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj<ubh: Call }(hj<hhhNhNubh)}(h ``madvise()``h]h madvise()}(hjRhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj<ubh for the region with }(hj<hhhNhNubh)}(h``MADV_NOHUGEPAGE``h]hMADV_NOHUGEPAGE}(hjdhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj<ubh. Supported by }(hj<hhhNhNubh)}(h ``vaddr``h]hvaddr}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj<ubh and }(hj<hhhNhNubh)}(h ``fvaddr``h]hfvaddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj<ubh operations set.}(hj<hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj8ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h\``lru_prio``: Prioritize the region on its LRU lists. Supported by ``paddr`` operations set.h]h)}(h\``lru_prio``: Prioritize the region on its LRU lists. Supported by ``paddr`` operations set.h](h)}(h ``lru_prio``h]hlru_prio}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh7: Prioritize the region on its LRU lists. Supported by }(hjhhhNhNubh)}(h ``paddr``h]hpaddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh operations set.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h```lru_deprio``: Deprioritize the region on its LRU lists. Supported by ``paddr`` operations set.h]h)}(h```lru_deprio``: Deprioritize the region on its LRU lists. Supported by ``paddr`` operations set.h](h)}(h``lru_deprio``h]h lru_deprio}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh9: Deprioritize the region on its LRU lists. Supported by }(hjhhhNhNubh)}(h ``paddr``h]hpaddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh operations set.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hh``migrate_hot``: Migrate the regions prioritizing warmer regions. Supported by ``paddr`` operations set.h]h)}(hh``migrate_hot``: Migrate the regions prioritizing warmer regions. Supported by ``paddr`` operations set.h](h)}(h``migrate_hot``h]h migrate_hot}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh@: Migrate the regions prioritizing warmer regions. Supported by }(hjhhhNhNubh)}(h ``paddr``h]hpaddr}(hj0hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh operations set.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hi``migrate_cold``: Migrate the regions prioritizing colder regions. Supported by ``paddr`` operations set.h]h)}(hi``migrate_cold``: Migrate the regions prioritizing colder regions. Supported by ``paddr`` operations set.h](h)}(h``migrate_cold``h]h migrate_cold}(hjVhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjRubh@: Migrate the regions prioritizing colder regions. Supported by }(hjRhhhNhNubh)}(h ``paddr``h]hpaddr}(hjhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjRubh operations set.}(hjRhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjNubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hQ``stat``: Do nothing but count the statistics. Supported by all operations sets. h]h)}(hP``stat``: Do nothing but count the statistics. Supported by all operations sets.h](h)}(h``stat``h]hstat}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhH: Do nothing but count the statistics. Supported by all operations sets.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]j6j7uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1jhhhMhj>hhubh)}(hApplying 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.h](hApplying the actions except }(hjhhhNhNubh)}(h``stat``h]hstat}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh 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.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj>hhubh)}(hTo know how user-space can set the action via :ref:`DAMON sysfs interface `, refer to :ref:`action ` part of the documentation.h](h.To know how user-space can set the action via }(hjhhhNhNubh)}(h.:ref:`DAMON sysfs interface `h]j+)}(hjh]hDAMON sysfs interface}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIsysfs_interfaceuh1hhhhMhjubh , refer to }(hjhhhNhNubh)}(h:ref:`action `h]j+)}(hjh]haction}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjI sysfs_schemeuh1hhhhMhjubh part of the documentation.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj>hhubh)}(h&.. _damon_design_damos_access_pattern:h]h}(h]h ]h"]h$]h&]hՌ!damon-design-damos-access-patternuh1hhMhj>hhhhubeh}(h](operation-actionj=eh ]h"](operation actiondamon_design_damos_actioneh$]h&]uh1hhj2 hhhhhMj^}j?j3sj`}j=j3subh)}(hhh](h)}(hTarget Access Patternh]hTarget Access Pattern}(hjGhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjDhhhhhMubh)}(hXThe access pattern of the schemes' interest. The patterns are constructed with the properties that DAMON's monitoring results provide, specifically the size, the access frequency, and the age. Users can describe their access pattern of interest by setting minimum and maximum values of the three properties. If a region's three properties are in the ranges, DAMOS classifies it as one of the regions that the scheme is having an interest in.h]hXThe access pattern of the schemes’ interest. The patterns are constructed with the properties that DAMON’s monitoring results provide, specifically the size, the access frequency, and the age. Users can describe their access pattern of interest by setting minimum and maximum values of the three properties. If a region’s three properties are in the ranges, DAMOS classifies it as one of the regions that the scheme is having an interest in.}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjDhhubh)}(hTo know how user-space can set the access pattern via :ref:`DAMON sysfs interface `, refer to :ref:`access_pattern ` part of the documentation.h](h6To know how user-space can set the access pattern via }(hjchhhNhNubh)}(h.:ref:`DAMON sysfs interface `h]j+)}(hjmh]hDAMON sysfs interface}(hjohhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjkubah}(h]h ]h"]h$]h&]refdocjC refdomainjyreftyperef refexplicitrefwarnjIsysfs_interfaceuh1hhhhMhjcubh , refer to }(hjchhhNhNubh)}(h,:ref:`access_pattern `h]j+)}(hjh]haccess_pattern}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIsysfs_access_patternuh1hhhhMhjcubh part of the documentation.}(hjchhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjDhhubh)}(h.. _damon_design_damos_quotas:h]h}(h]h ]h"]h$]h&]hՌdamon-design-damos-quotasuh1hhMhjDhhhhubeh}(h](target-access-patternj8eh ]h"](target access pattern!damon_design_damos_access_patterneh$]h&]uh1hhj2 hhhhhMj^}jj.sj`}j8j.subh)}(hhh](h)}(hQuotash]hQuotas}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hXDAMOS upper-bound overhead control feature. DAMOS could incur high overhead if the target access pattern is not properly tuned. For example, if a huge memory region having the access pattern of interest is found, applying the scheme's action to all pages of the huge region could consume unacceptably large system resources. Preventing such issues by tuning the access pattern could be challenging, especially if the access patterns of the workloads are highly dynamic.h]hXDAMOS upper-bound overhead control feature. DAMOS could incur high overhead if the target access pattern is not properly tuned. For example, if a huge memory region having the access pattern of interest is found, applying the scheme’s action to all pages of the huge region could consume unacceptably large system resources. Preventing such issues by tuning the access pattern could be challenging, especially if the access patterns of the workloads are highly dynamic.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hX*To mitigate that situation, DAMOS provides an upper-bound overhead control feature called quotas. It lets users specify an upper limit of time that DAMOS can use for applying the action, and/or a maximum bytes of memory regions that the action can be applied within a user-specified time duration.h]hX*To mitigate that situation, DAMOS provides an upper-bound overhead control feature called quotas. It lets users specify an upper limit of time that DAMOS can use for applying the action, and/or a maximum bytes of memory regions that the action can be applied within a user-specified time duration.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hTo know how user-space can set the basic quotas via :ref:`DAMON sysfs interface `, refer to :ref:`quotas ` part of the documentation.h](h4To know how user-space can set the basic quotas via }(hjhhhNhNubh)}(h.:ref:`DAMON sysfs interface `h]j+)}(hjh]hDAMON sysfs interface}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIsysfs_interfaceuh1hhhhMhjubh , refer to }(hjhhhNhNubh)}(h:ref:`quotas `h]j+)}(hj*h]hquotas}(hj,hhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj(ubah}(h]h ]h"]h$]h&]refdocjC refdomainj6reftyperef refexplicitrefwarnjI sysfs_quotasuh1hhhhMhjubh part of the documentation.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h-.. _damon_design_damos_quotas_prioritization:h]h}(h]h ]h"]h$]h&]hՌ(damon-design-damos-quotas-prioritizationuh1hhMhjhhhhubh)}(hhh](h)}(hPrioritizationh]hPrioritization}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj]hhhhhMubh)}(hXA mechanism for making a good decision under the quotas. When the action cannot be applied to all regions of interest due to the quotas, DAMOS prioritizes regions and applies the action to only regions having high enough priorities so that it will not exceed the quotas.h]hXA mechanism for making a good decision under the quotas. When the action cannot be applied to all regions of interest due to the quotas, DAMOS prioritizes regions and applies the action to only regions having high enough priorities so that it will not exceed the quotas.}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj]hhubh)}(hXThe prioritization mechanism should be different for each action. For example, rarely accessed (colder) memory regions would be prioritized for page-out scheme action. In contrast, the colder regions would be deprioritized for huge page collapse scheme action. Hence, the prioritization mechanisms for each action are implemented in each DAMON operations set, together with the actions.h]hXThe prioritization mechanism should be different for each action. For example, rarely accessed (colder) memory regions would be prioritized for page-out scheme action. In contrast, the colder regions would be deprioritized for huge page collapse scheme action. Hence, the prioritization mechanisms for each action are implemented in each DAMON operations set, together with the actions.}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhj]hhubh)}(hXvThough the implementation is up to the DAMON operations set, it would be common to calculate the priority using the access pattern properties of the regions. Some users would want the mechanisms to be personalized for their specific case. For example, some users would want the mechanism to weigh the recency (``age``) more than the access frequency (``nr_accesses``). DAMOS allows users to specify the weight of each access pattern property and passes the information to the underlying mechanism. Nevertheless, how and even whether the weight will be respected are up to the underlying prioritization mechanism implementation.h](hX7Though the implementation is up to the DAMON operations set, it would be common to calculate the priority using the access pattern properties of the regions. Some users would want the mechanisms to be personalized for their specific case. For example, some users would want the mechanism to weigh the recency (}(hjhhhNhNubh)}(h``age``h]hage}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh") more than the access frequency (}(hjhhhNhNubh)}(h``nr_accesses``h]h nr_accesses}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhX). DAMOS allows users to specify the weight of each access pattern property and passes the information to the underlying mechanism. Nevertheless, how and even whether the weight will be respected are up to the underlying prioritization mechanism implementation.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj]hhubh)}(hTo know how user-space can set the prioritization weights via :ref:`DAMON sysfs interface `, refer to :ref:`weights ` part of the documentation.h](h>To know how user-space can set the prioritization weights via }(hjhhhNhNubh)}(h.:ref:`DAMON sysfs interface `h]j+)}(hjh]hDAMON sysfs interface}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIsysfs_interfaceuh1hhhhMhjubh , refer to }(hjhhhNhNubh)}(h:ref:`weights `h]j+)}(hjh]hweights}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjI sysfs_quotasuh1hhhhMhjubh part of the documentation.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhj]hhubh)}(h*.. _damon_design_damos_quotas_auto_tuning:h]h}(h]h ]h"]h$]h&]hՌ%damon-design-damos-quotas-auto-tuninguh1hhMhj]hhhhubeh}(h](prioritizationj\eh ]h"](prioritization(damon_design_damos_quotas_prioritizationeh$]h&]uh1hhjhhhhhMj^}j#jRsj`}j\jRsubh)}(hhh](h)}(h(Aim-oriented Feedback-driven Auto-tuningh]h(Aim-oriented Feedback-driven Auto-tuning}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj(hhhhhM ubh)}(hXAutomatic feedback-driven quota tuning. Instead of setting the absolute quota value, users can specify the metric of their interest, and what target value they want the metric value to be. DAMOS then automatically tunes the aggressiveness (the quota) of the corresponding scheme. For example, if DAMOS is under achieving the goal, DAMOS automatically increases the quota. If DAMOS is over achieving the goal, it decreases the quota.h]hXAutomatic feedback-driven quota tuning. Instead of setting the absolute quota value, users can specify the metric of their interest, and what target value they want the metric value to be. DAMOS then automatically tunes the aggressiveness (the quota) of the corresponding scheme. For example, if DAMOS is under achieving the goal, DAMOS automatically increases the quota. If DAMOS is over achieving the goal, it decreases the quota.}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM"hj(hhubh)}(hXThe goal can be specified with three parameters, namely ``target_metric``, ``target_value``, and ``current_value``. The auto-tuning mechanism tries to make ``current_value`` of ``target_metric`` be same to ``target_value``. Currently, two ``target_metric`` are provided.h](h8The goal can be specified with three parameters, namely }(hjGhhhNhNubh)}(h``target_metric``h]h target_metric}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGubh, }(hjGhhhNhNubh)}(h``target_value``h]h target_value}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGubh, and }(hjGhhhNhNubh)}(h``current_value``h]h current_value}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGubh+. The auto-tuning mechanism tries to make }(hjGhhhNhNubh)}(h``current_value``h]h current_value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGubh of }(hjGhhhNhNubh)}(h``target_metric``h]h target_metric}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGubh be same to }(hjGhhhNhNubh)}(h``target_value``h]h target_value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGubh. Currently, two }(hjGhhhNhNubh)}(h``target_metric``h]h target_metric}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjGubh are provided.}(hjGhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM)hj(hhubj)}(hhh](j)}(hX``user_input``: User-provided value. Users could use any metric that they has interest in for the value. Use space main workload's latency or throughput, system metrics like free memory ratio or memory pressure stall time (PSI) could be examples. Note that users should explicitly set ``current_value`` on their own in this case. In other words, users should repeatedly provide the feedback.h]h)}(hX``user_input``: User-provided value. Users could use any metric that they has interest in for the value. Use space main workload's latency or throughput, system metrics like free memory ratio or memory pressure stall time (PSI) could be examples. Note that users should explicitly set ``current_value`` on their own in this case. In other words, users should repeatedly provide the feedback.h](h)}(h``user_input``h]h user_input}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhX: User-provided value. Users could use any metric that they has interest in for the value. Use space main workload’s latency or throughput, system metrics like free memory ratio or memory pressure stall time (PSI) could be examples. Note that users should explicitly set }(hjhhhNhNubh)}(h``current_value``h]h current_value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhZ on their own in this case. In other words, users should repeatedly provide the feedback.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM.hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hX-``some_mem_psi_us``: System-wide ``some`` memory pressure stall information in microseconds that measured from last quota reset to next quota reset. DAMOS does the measurement on its own, so only ``target_value`` need to be set by users at the initial time. In other words, DAMOS does self-feedback. h]h)}(hX,``some_mem_psi_us``: System-wide ``some`` memory pressure stall information in microseconds that measured from last quota reset to next quota reset. DAMOS does the measurement on its own, so only ``target_value`` need to be set by users at the initial time. In other words, DAMOS does self-feedback.h](h)}(h``some_mem_psi_us``h]hsome_mem_psi_us}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh: System-wide }(hjhhhNhNubh)}(h``some``h]hsome}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh memory pressure stall information in microseconds that measured from last quota reset to next quota reset. DAMOS does the measurement on its own, so only }(hjhhhNhNubh)}(h``target_value``h]h target_value}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhX need to be set by users at the initial time. In other words, DAMOS does self-feedback.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM4hjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]j6j7uh1jhhhM.hj(hhubh)}(hTo know how user-space can set the tuning goal metric, the target value, and/or the current value via :ref:`DAMON sysfs interface `, refer to :ref:`quota goals ` part of the documentation.h](hfTo know how user-space can set the tuning goal metric, the target value, and/or the current value via }(hj^hhhNhNubh)}(h.:ref:`DAMON sysfs interface `h]j+)}(hjhh]hDAMON sysfs interface}(hjjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjfubah}(h]h ]h"]h$]h&]refdocjC refdomainjtreftyperef refexplicitrefwarnjIsysfs_interfaceuh1hhhhM9hj^ubh , refer to }(hj^hhhNhNubh)}(h.:ref:`quota goals `h]j+)}(hjh]h quota goals}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIsysfs_schemes_quota_goalsuh1hhhhM9hj^ubh part of the documentation.}(hj^hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhM9hj(hhubh)}(h".. _damon_design_damos_watermarks:h]h}(h]h ]h"]h$]h&]hՌdamon-design-damos-watermarksuh1hhM>hj(hhhhubeh}(h]((aim-oriented-feedback-driven-auto-tuningjeh ]h"]((aim-oriented feedback-driven auto-tuning%damon_design_damos_quotas_auto_tuningeh$]h&]uh1hhjhhhhhM j^}jjsj`}jjsubeh}(h](quotasjeh ]h"](quotasdamon_design_damos_quotaseh$]h&]uh1hhj2 hhhhhMj^}jjsj`}jjsubh)}(hhh](h)}(h Watermarksh]h Watermarks}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMAubh)}(hXConditional DAMOS (de)activation automation. Users might want DAMOS to run only under certain situations. For example, when a sufficient amount of free memory is guaranteed, running a scheme for proactive reclamation would only consume unnecessary system resources. To avoid such consumption, the user would need to manually monitor some metrics such as free memory ratio, and turn DAMON/DAMOS on or off.h]hXConditional DAMOS (de)activation automation. Users might want DAMOS to run only under certain situations. For example, when a sufficient amount of free memory is guaranteed, running a scheme for proactive reclamation would only consume unnecessary system resources. To avoid such consumption, the user would need to manually monitor some metrics such as free memory ratio, and turn DAMON/DAMOS on or off.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMChjhhubh)}(hXdDAMOS allows users to offload such works using three watermarks. It allows the users to configure the metric of their interest, and three watermark values, namely high, middle, and low. If the value of the metric becomes above the high watermark or below the low watermark, the scheme is deactivated. If the metric becomes below the mid watermark but above the low watermark, the scheme is activated. If all schemes are deactivated by the watermarks, the monitoring is also deactivated. In this case, the DAMON worker thread only periodically checks the watermarks and therefore incurs nearly zero overhead.h]hXdDAMOS allows users to offload such works using three watermarks. It allows the users to configure the metric of their interest, and three watermark values, namely high, middle, and low. If the value of the metric becomes above the high watermark or below the low watermark, the scheme is deactivated. If the metric becomes below the mid watermark but above the low watermark, the scheme is activated. If all schemes are deactivated by the watermarks, the monitoring is also deactivated. In this case, the DAMON worker thread only periodically checks the watermarks and therefore incurs nearly zero overhead.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMJhjhhubh)}(hTo know how user-space can set the watermarks via :ref:`DAMON sysfs interface `, refer to :ref:`watermarks ` part of the documentation.h](h2To know how user-space can set the watermarks via }(hjhhhNhNubh)}(h.:ref:`DAMON sysfs interface `h]j+)}(hj h]hDAMON sysfs interface}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj ubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIsysfs_interfaceuh1hhhhMShjubh , refer to }(hjhhhNhNubh)}(h$:ref:`watermarks `h]j+)}(hj0h]h watermarks}(hj2hhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj.ubah}(h]h ]h"]h$]h&]refdocjC refdomainj<reftyperef refexplicitrefwarnjIsysfs_watermarksuh1hhhhMShjubh part of the documentation.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMShjhhubh)}(h.. _damon_design_damos_filters:h]h}(h]h ]h"]h$]h&]hՌdamon-design-damos-filtersuh1hhMXhjhhhhubeh}(h]( watermarksjeh ]h"]( watermarksdamon_design_damos_watermarkseh$]h&]uh1hhj2 hhhhhMAj^}jijsj`}jjsubh)}(hhh](h)}(hFiltersh]hFilters}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjnhhhhhM[ubh)}(hXNon-access pattern-based target memory regions filtering. If users run self-written programs or have good profiling tools, they could know something more than the kernel, such as future access patterns or some special requirements for specific types of memory. For example, some users may know only anonymous pages can impact their program's performance. They can also have a list of latency-critical processes.h]hXNon-access pattern-based target memory regions filtering. If users run self-written programs or have good profiling tools, they could know something more than the kernel, such as future access patterns or some special requirements for specific types of memory. For example, some users may know only anonymous pages can impact their program’s performance. They can also have a list of latency-critical processes.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM]hjnhhubh)}(hTo let users optimize DAMOS schemes with such special knowledge, DAMOS provides a feature called DAMOS filters. The feature allows users to set an arbitrary number of filters for each scheme. Each filter specifiesh]hTo let users optimize DAMOS schemes with such special knowledge, DAMOS provides a feature called DAMOS filters. The feature allows users to set an arbitrary number of filters for each scheme. Each filter specifies}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMdhjnhhubj)}(hhh](j)}(ha type of memory (``type``),h]h)}(hjh](ha type of memory (}(hjhhhNhNubh)}(h``type``h]htype}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh),}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hSwhether it is for the memory of the type or all except the type (``matching``), andh]h)}(hSwhether it is for the memory of the type or all except the type (``matching``), andh](hAwhether it is for the memory of the type or all except the type (}(hjhhhNhNubh)}(h ``matching``h]hmatching}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh), and}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMihjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj)}(hmwhether it is to allow (include) or reject (exclude) applying the scheme's action to the memory (``allow``). h]h)}(hlwhether it is to allow (include) or reject (exclude) applying the scheme's action to the memory (``allow``).h](hcwhether it is to allow (include) or reject (exclude) applying the scheme’s action to the memory (}(hjhhhNhNubh)}(h ``allow``h]hallow}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMkhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]j6j7uh1jhhhMhhjnhhubh)}(hXFor efficient handling of filters, some types of filters are handled by the core layer, while others are handled by operations set. In the latter case, hence, support of the filter types depends on the DAMON operations set. In case of the core layer-handled filters, the memory regions that excluded by the filter are not counted as the scheme has tried to the region. In contrast, if a memory regions is filtered by an operations set layer-handled filter, it is counted as the scheme has tried. This difference affects the statistics.h]hXFor efficient handling of filters, some types of filters are handled by the core layer, while others are handled by operations set. In the latter case, hence, support of the filter types depends on the DAMON operations set. In case of the core layer-handled filters, the memory regions that excluded by the filter are not counted as the scheme has tried to the region. In contrast, if a memory regions is filtered by an operations set layer-handled filter, it is counted as the scheme has tried. This difference affects the statistics.}(hj!hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMnhjnhhubh)}(hXmWhen multiple filters are installed, the group of filters that handled by the core layer are evaluated first. After that, the group of filters that handled by the operations layer are evaluated. Filters in each of the groups are evaluated in the installed order. If a part of memory is matched to one of the filter, next filters are ignored. If the part passes through the filters evaluation stage because it is not matched to any of the filters, applying the scheme's action to it depends on the last filter's allowance type. If the last filter was for allowing, the part of memory will be rejected, and vice versa.h]hXqWhen multiple filters are installed, the group of filters that handled by the core layer are evaluated first. After that, the group of filters that handled by the operations layer are evaluated. Filters in each of the groups are evaluated in the installed order. If a part of memory is matched to one of the filter, next filters are ignored. If the part passes through the filters evaluation stage because it is not matched to any of the filters, applying the scheme’s action to it depends on the last filter’s allowance type. If the last filter was for allowing, the part of memory will be rejected, and vice versa.}(hj/hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMvhjnhhubh)}(hXFor example, let's assume 1) a filter for allowing anonymous pages and 2) another filter for rejecting young pages are installed in the order. If a page of a region that eligible to apply the scheme's action is an anonymous page, the scheme's action will be applied to the page regardless of whether it is young or not, since it matches with the first allow-filter. If the page is not anonymous but young, the scheme's action will not be applied, since the second reject-filter blocks it. If the page is neither anonymous nor young, the page will pass through the filters evaluation stage since there is no matching filter, and the action will be applied to the page.h]hXFor example, let’s assume 1) a filter for allowing anonymous pages and 2) another filter for rejecting young pages are installed in the order. If a page of a region that eligible to apply the scheme’s action is an anonymous page, the scheme’s action will be applied to the page regardless of whether it is young or not, since it matches with the first allow-filter. If the page is not anonymous but young, the scheme’s action will not be applied, since the second reject-filter blocks it. If the page is neither anonymous nor young, the page will pass through the filters evaluation stage since there is no matching filter, and the action will be applied to the page.}(hj=hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjnhhubh)}(h2Below ``type`` of filters are currently supported.h](hBelow }(hjKhhhNhNubh)}(h``type``h]htype}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKubh$ of filters are currently supported.}(hjKhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjnhhubj)}(hhh](j)}(hCore layer handled - addr - Applied to pages that belonging to a given address range. - target - Applied to pages that belonging to a given DAMON monitoring target.h]hdefinition_list)}(hhh]hdefinition_list_item)}(hCore layer handled - addr - Applied to pages that belonging to a given address range. - target - Applied to pages that belonging to a given DAMON monitoring target.h](hterm)}(hCore layer handledh]hCore layer handled}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j}hhhMhjyubh definition)}(hhh]j)}(hhh](j)}(hBaddr - Applied to pages that belonging to a given address range.h]js)}(hhh]jx)}(h@addr - Applied to pages that belonging to a given address range.h](j~)}(haddrh]haddr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j}hhhMhjubj)}(hhh]j)}(hhh]j)}(h9Applied to pages that belonging to a given address range.h]h)}(hjh]h9Applied to pages that belonging to a given address range.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]j6j7uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jwhhhMhjubah}(h]h ]h"]h$]h&]uh1jrhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hNtarget - Applied to pages that belonging to a given DAMON monitoring target.h]js)}(hhh]jx)}(hLtarget - Applied to pages that belonging to a given DAMON monitoring target.h](j~)}(htargeth]htarget}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j}hhhMhjubj)}(hhh]j)}(hhh]j)}(hCApplied to pages that belonging to a given DAMON monitoring target.h]h)}(hj h]hCApplied to pages that belonging to a given DAMON monitoring target.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]j6j7uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jwhhhMhjubah}(h]h ]h"]h$]h&]uh1jrhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]j6j7uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjyubeh}(h]h ]h"]h$]h&]uh1jwhhhMhjtubah}(h]h ]h"]h$]h&]uh1jrhjnubah}(h]h ]h"]h$]h&]uh1jhjkhhhNhNubj)}(hXOperations layer handled, supported by only ``paddr`` operations set. - anon - Applied to pages that containing data that not stored in files. - active - Applied to active pages. - memcg - Applied to pages that belonging to a given cgroup. - young - Applied to pages that are accessed after the last access check from the scheme. - hugepage_size - Applied to pages that managed in a given size range. - unmapped - Applied to pages that unmapped. h]js)}(hhh]jx)}(hXOperations layer handled, supported by only ``paddr`` operations set. - anon - Applied to pages that containing data that not stored in files. - active - Applied to active pages. - memcg - Applied to pages that belonging to a given cgroup. - young - Applied to pages that are accessed after the last access check from the scheme. - hugepage_size - Applied to pages that managed in a given size range. - unmapped - Applied to pages that unmapped. h](j~)}(hEOperations layer handled, supported by only ``paddr`` operations set.h](h,Operations layer handled, supported by only }(hjfhhhNhNubh)}(h ``paddr``h]hpaddr}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjfubh operations set.}(hjfhhhNhNubeh}(h]h ]h"]h$]h&]uh1j}hhhMhjbubj)}(hhh]j)}(hhh](j)}(hHanon - Applied to pages that containing data that not stored in files.h]js)}(hhh]jx)}(hFanon - Applied to pages that containing data that not stored in files.h](j~)}(hanonh]hanon}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j}hhhMhjubj)}(hhh]j)}(hhh]j)}(h?Applied to pages that containing data that not stored in files.h]h)}(hjh]h?Applied to pages that containing data that not stored in files.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]j6j7uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jwhhhMhjubah}(h]h ]h"]h$]h&]uh1jrhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h#active - Applied to active pages.h]js)}(hhh]jx)}(h!active - Applied to active pages.h](j~)}(hactiveh]hactive}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j}hhhMhjubj)}(hhh]j)}(hhh]j)}(hApplied to active pages.h]h)}(hjh]hApplied to active pages.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]j6j7uh1jhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jwhhhMhjubah}(h]h ]h"]h$]h&]uh1jrhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h`, refer to :ref:`filters ` part of the documentation.h](h/To know how user-space can set the filters via }(hjhhhNhNubh)}(h.:ref:`DAMON sysfs interface `h]j+)}(hjh]hDAMON sysfs interface}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIsysfs_interfaceuh1hhhhMhjubh , refer to }(hjhhhNhNubh)}(h:ref:`filters `h]j+)}(hjh]hfilters}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjI sysfs_filtersuh1hhhhMhjubh part of the documentation.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjnhhubh)}(h.. _damon_design_damos_stat:h]h}(h]h ]h"]h$]h&]hՌdamon-design-damos-statuh1hhMhjnhhhhubeh}(h](filtersjbeh ]h"](filtersdamon_design_damos_filterseh$]h&]uh1hhj2 hhhhhM[j^}jjXsj`}jbjXsubh)}(hhh](h)}(h Statisticsh]h Statistics}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hbThe statistics of DAMOS behaviors that designed to help monitoring, tuning and debugging of DAMOS.h]hbThe statistics of DAMOS behaviors that designed to help monitoring, tuning and debugging of DAMOS.}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h^DAMOS accounts below statistics for each scheme, from the beginning of the scheme's execution.h]h`DAMOS accounts below statistics for each scheme, from the beginning of the scheme’s execution.}(hj5hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubj)}(hhh](j)}(hM``nr_tried``: Total number of regions that the scheme is tried to be applied.h]h)}(hjHh](h)}(h ``nr_tried``h]hnr_tried}(hjMhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjJubhA: Total number of regions that the scheme is tried to be applied.}(hjJhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjFubah}(h]h ]h"]h$]h&]uh1jhjChhhhhNubj)}(hL``sz_trtied``: Total size of regions that the scheme is tried to be applied.h]h)}(hjmh](h)}(h ``sz_trtied``h]h sz_trtied}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjoubh?: Total size of regions that the scheme is tried to be applied.}(hjohhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjkubah}(h]h ]h"]h$]h&]uh1jhjChhhhhNubj)}(h]``sz_ops_filter_passed``: Total bytes that passed operations set layer-handled DAMOS filters.h]h)}(h]``sz_ops_filter_passed``: Total bytes that passed operations set layer-handled DAMOS filters.h](h)}(h``sz_ops_filter_passed``h]hsz_ops_filter_passed}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubhE: Total bytes that passed operations set layer-handled DAMOS filters.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjChhhhhNubj)}(hC``nr_applied``: Total number of regions that the scheme is applied.h]h)}(hjh](h)}(h``nr_applied``h]h nr_applied}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh5: Total number of regions that the scheme is applied.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjChhhhhNubj)}(hA``sz_applied``: Total size of regions that the scheme is applied.h]h)}(hjh](h)}(h``sz_applied``h]h sz_applied}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh3: Total size of regions that the scheme is applied.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjChhhhhNubj)}(hL``qt_exceeds``: Total number of times the quota of the scheme has exceeded. h]h)}(hK``qt_exceeds``: Total number of times the quota of the scheme has exceeded.h](h)}(h``qt_exceeds``h]h qt_exceeds}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh=: Total number of times the quota of the scheme has exceeded.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjubah}(h]h ]h"]h$]h&]uh1jhjChhhhhNubeh}(h]h ]h"]h$]h&]j6j7uh1jhhhMhjhhubh)}(hX~"A scheme is tried to be applied to a region" means DAMOS core logic determined the region is eligible to apply the scheme's :ref:`action `. The :ref:`access pattern `, :ref:`quotas `, :ref:`watermarks `, and :ref:`filters ` that handled on core logic could affect this. The core logic will only ask the underlying :ref:`operation set ` to do apply the action to the region, so whether the action is really applied or not is unclear. That's why it is called "tried".h](h“A scheme is tried to be applied to a region” means DAMOS core logic determined the region is eligible to apply the scheme’s }(hj,hhhNhNubh)}(h):ref:`action `h]j+)}(hj6h]haction}(hj8hhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj4ubah}(h]h ]h"]h$]h&]refdocjC refdomainjBreftyperef refexplicitrefwarnjIdamon_design_damos_actionuh1hhhhMhj,ubh. The }(hj,hhhNhNubh)}(h9:ref:`access pattern `h]j+)}(hjZh]haccess pattern}(hj\hhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjXubah}(h]h ]h"]h$]h&]refdocjC refdomainjfreftyperef refexplicitrefwarnjI!damon_design_damos_access_patternuh1hhhhMhj,ubh, }(hj,hhhNhNubh)}(h):ref:`quotas `h]j+)}(hj~h]hquotas}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj|ubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIdamon_design_damos_quotasuh1hhhhMhj,ubh, }hj,sbh)}(h1:ref:`watermarks `h]j+)}(hjh]h watermarks}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIdamon_design_damos_watermarksuh1hhhhMhj,ubh, and }(hj,hhhNhNubh)}(h+:ref:`filters `h]j+)}(hjh]hfilters}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIdamon_design_damos_filtersuh1hhhhMhj,ubh[ that handled on core logic could affect this. The core logic will only ask the underlying }(hj,hhhNhNubh)}(h+:ref:`operation set `h]j+)}(hjh]h operation set}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIdamon_operations_setuh1hhhhMhj,ubh to do apply the action to the region, so whether the action is really applied or not is unclear. That’s why it is called “tried”.}(hj,hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hX3"A scheme is applied to a region" means the :ref:`operation set ` has applied the action to at least a part of the region. The :ref:`filters ` that handled by the operation set, and the types of the :ref:`action ` and the pages of the region can affect this. For example, if a filter is set to exclude anonymous pages and the region has only anonymous pages, or if the action is ``pageout`` while all pages of the region are unreclaimable, applying the action to the region will fail.h](h0“A scheme is applied to a region” means the }(hjhhhNhNubh)}(h+:ref:`operation set `h]j+)}(hjh]h operation set}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainj(reftyperef refexplicitrefwarnjIdamon_operations_setuh1hhhhMhjubh? has applied the action to at least a part of the region. The }(hjhhhNhNubh)}(h+:ref:`filters `h]j+)}(hj@h]hfilters}(hjBhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj>ubah}(h]h ]h"]h$]h&]refdocjC refdomainjLreftyperef refexplicitrefwarnjIdamon_design_damos_filtersuh1hhhhMhjubh9 that handled by the operation set, and the types of the }(hjhhhNhNubh)}(h):ref:`action `h]j+)}(hjdh]haction}(hjfhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjbubah}(h]h ]h"]h$]h&]refdocjC refdomainjpreftyperef refexplicitrefwarnjIdamon_design_damos_actionug[h1hhhhMhjubh and the pages of the region can affect this. For example, if a filter is set to exclude anonymous pages and the region has only anonymous pages, or if the action is }(hjhhhNhNubh)}(h ``pageout``h]hpageout}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh^ while all pages of the region are unreclaimable, applying the action to the region will fail.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hTo know how user-space can read the stats via :ref:`DAMON sysfs interface `, refer to :ref:s`stats ` part of the documentation.h](h.To know how user-space can read the stats via }(hjhhhNhNubh)}(h.:ref:`DAMON sysfs interface `h]j+)}(hjh]hDAMON sysfs interface}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIsysfs_interfaceuh1hhhhMhjubhA, refer to :ref:s`stats ` part of the documentation.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]( statisticsj eh ]h"]( statisticsdamon_design_damos_stateh$]h&]uh1hhj2 hhhhhMj^}jjsj`}j jsubh)}(hhh](h)}(hRegions Walkingh]hRegions Walking}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hXDAMOS feature allowing users access each region that a DAMOS action has just applied. Using this feature, DAMON :ref:`API ` allows users access full properties of the regions including the access monitoring results and amount of the region's internal memory that passed the DAMOS filters. :ref:`DAMON sysfs interface ` also allows users read the data via special :ref:`files `.h](hqDAMOS feature allowing users access each region that a DAMOS action has just applied. Using this feature, DAMON }(hjhhhNhNubh)}(h:ref:`API `h]j+)}(hjh]hAPI}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIdamon_design_apiuh1hhhhMhjubh allows users access full properties of the regions including the access monitoring results and amount of the region’s internal memory that passed the DAMOS filters. }(hjhhhNhNubh)}(h.:ref:`DAMON sysfs interface `h]j+)}(hjh]hDAMON sysfs interface}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainj&reftyperef refexplicitrefwarnjIsysfs_interfaceuh1hhhhMhjubh- also allows users read the data via special }(hjhhhNhNubh)}(h*:ref:`files `h]j+)}(hj>h]hfiles}(hj@hhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hj<ubah}(h]h ]h"]h$]h&]refdocjC refdomainjJreftyperef refexplicitrefwarnjIsysfs_schemes_tried_regionsuh1hhhhMhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h.. _damon_design_api:h]h}(h]h ]h"]h$]h&]hՌdamon-design-apiuh1hhMhjhhhhubeh}(h]regions-walkingah ]h"]regions walkingah$]h&]uh1hhj2 hhhhhMubeh}(h](operation-schemesj eh ]h"](operation schemesdamon_design_damoseh$]h&]uh1hhjhhhhhMyj^}jj sj`}j j subh)}(hhh](h)}(h!Application Programming Interfaceh]h!Application Programming Interface}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hXThe programming interface for kernel space data access-aware applications. DAMON is a framework, so it does nothing by itself. Instead, it only helps other kernel components such as subsystems and modules building their data access-aware applications using DAMON's core features. For this, DAMON exposes its all features to other kernel components via its application programming interface, namely ``include/linux/damon.h``. Please refer to the API :doc:`document ` for details of the interface.h](hXThe programming interface for kernel space data access-aware applications. DAMON is a framework, so it does nothing by itself. Instead, it only helps other kernel components such as subsystems and modules building their data access-aware applications using DAMON’s core features. For this, DAMON exposes its all features to other kernel components via its application programming interface, namely }(hjhhhNhNubh)}(h``include/linux/damon.h``h]hinclude/linux/damon.h}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh. Please refer to the API }(hjhhhNhNubh)}(h:doc:`document `h]j+)}(hjh]hdocument}(hjhhhNhNubah}(h]h ](j6stdstd-doceh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftypedoc refexplicitrefwarnjI /mm/damon/apiuh1hhhhMhjubh for details of the interface.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(h.. _damon_modules:h]h}(h]h ]h"]h$]h&]hՌ damon-modulesuh1hhMhjhhhhubeh}(h](!application-programming-interfacejpeh ]h"](!application programming interfacedamon_design_apieh$]h&]uh1hhjhhhhhMj^}jjfsj`}jpjfsubeh}(h]( core-logicsjeh ]h"]( core logicsdamon_core_logiceh$]h&]uh1hhhhhhhhKj^}jjsj`}jjsubh)}(hhh](h)}(hModulesh]hModules}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hX9Because the core of DAMON is a framework for kernel components, it doesn't provide any direct interface for the user space. Such interfaces should be implemented by each DAMON API user kernel components, instead. DAMON subsystem itself implements such DAMON API user modules, which are supposed to be used for general purpose DAMON control and special purpose data access-aware system operations, and provides stable application binary interfaces (ABI) for the user space. The user space can build their efficient data access-aware applications using the interfaces.h]hX;Because the core of DAMON is a framework for kernel components, it doesn’t provide any direct interface for the user space. Such interfaces should be implemented by each DAMON API user kernel components, instead. DAMON subsystem itself implements such DAMON API user modules, which are supposed to be used for general purpose DAMON control and special purpose data access-aware system operations, and provides stable application binary interfaces (ABI) for the user space. The user space can build their efficient data access-aware applications using the interfaces.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hhh](h)}(h&General Purpose User Interface Modulesh]h&General Purpose User Interface Modules}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hVDAMON modules that provide user space ABIs for general purpose DAMON usage in runtime.h]hVDAMON modules that provide user space ABIs for general purpose DAMON usage in runtime.}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXtLike many other ABIs, the modules create files on pseudo file systems like 'sysfs', allow users to specify their requests to and get the answers from DAMON by writing to and reading from the files. As a response to such I/O, DAMON user interface modules control DAMON and retrieve the results as user requested via the DAMON API, and return the results to the user-space.h]hXxLike many other ABIs, the modules create files on pseudo file systems like ‘sysfs’, allow users to specify their requests to and get the answers from DAMON by writing to and reading from the files. As a response to such I/O, DAMON user interface modules control DAMON and retrieve the results as user requested via the DAMON API, and return the results to the user-space.}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXThe ABIs are designed to be used for user space applications development, rather than human beings' fingers. Human users are recommended to use such user space tools. One such Python-written user space tool is available at Github (https://github.com/damonitor/damo), Pypi (https://pypistats.org/packages/damo), and Fedora (https://packages.fedoraproject.org/pkgs/python-damo/damo/).h](hThe ABIs are designed to be used for user space applications development, rather than human beings’ fingers. Human users are recommended to use such user space tools. One such Python-written user space tool is available at Github (}(hjFhhhNhNubh reference)}(h!https://github.com/damonitor/damoh]h!https://github.com/damonitor/damo}(hjPhhhNhNubah}(h]h ]h"]h$]h&]refurijRuh1jNhjFubh ), Pypi (}(hjFhhhNhNubjO)}(h#https://pypistats.org/packages/damoh]h#https://pypistats.org/packages/damo}(hjchhhNhNubah}(h]h ]h"]h$]h&]refurijeuh1jNhjFubh), and Fedora (}(hjFhhhNhNubjO)}(h9https://packages.fedoraproject.org/pkgs/python-damo/damo/h]h9https://packages.fedoraproject.org/pkgs/python-damo/damo/}(hjvhhhNhNubah}(h]h ]h"]h$]h&]refurijxuh1jNhjFubh).}(hjFhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hCurrently, one module for this type, namely 'DAMON sysfs interface' is available. Please refer to the ABI :ref:`doc ` for details of the interfaces.h](hoCurrently, one module for this type, namely ‘DAMON sysfs interface’ is available. Please refer to the ABI }(hjhhhNhNubh)}(h:ref:`doc `h]j+)}(hjh]hdoc}(hjhhhNhNubah}(h]h ](j6stdstd-refeh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainjreftyperef refexplicitrefwarnjIsysfs_interfaceuh1hhhhMhjubh for details of the interfaces.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]&general-purpose-user-interface-modulesah ]h"]&general purpose user interface modulesah$]h&]uh1hhjhhhhhMubh)}(hhh](h)}(h+Special-Purpose Access-aware Kernel Modulesh]h+Special-Purpose Access-aware Kernel Modules}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hKDAMON modules that provide user space ABI for specific purpose DAMON usage.h]hKDAMON modules that provide user space ABI for specific purpose DAMON usage.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXDAMON user interface modules are for full control of all DAMON features in runtime. For each special-purpose system-wide data access-aware system operations such as proactive reclamation or LRU lists balancing, the interfaces could be simplified by removing unnecessary knobs for the specific purpose, and extended for boot-time and even compile time control. Default values of DAMON control parameters for the usage would also need to be optimized for the purpose.h]hXDAMON user interface modules are for full control of all DAMON features in runtime. For each special-purpose system-wide data access-aware system operations such as proactive reclamation or LRU lists balancing, the interfaces could be simplified by removing unnecessary knobs for the specific purpose, and extended for boot-time and even compile time control. Default values of DAMON control parameters for the usage would also need to be optimized for the purpose.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh)}(hXrTo support such cases, yet more DAMON API user kernel modules that provide more simple and optimized user space interfaces are available. Currently, two modules for proactive reclamation and LRU lists manipulation are provided. For more detail, please read the usage documents for those (:doc:`/admin-guide/mm/damon/reclaim` and :doc:`/admin-guide/mm/damon/lru_sort`).h](hX"To support such cases, yet more DAMON API user kernel modules that provide more simple and optimized user space interfaces are available. Currently, two modules for proactive reclamation and LRU lists manipulation are provided. For more detail, please read the usage documents for those (}(hjhhhNhNubh)}(h$:doc:`/admin-guide/mm/damon/reclaim`h]j+)}(hj h]h/admin-guide/mm/damon/reclaim}(hj hhhNhNubah}(h]h ](j6stdstd-doceh"]h$]h&]uh1j*hjubah}(h]h ]h"]h$]h&]refdocjC refdomainj reftypedoc refexplicitrefwarnjI/admin-guide/mm/damon/reclaimuh1hhhhMhjubh and }(hjhhhNhNubh)}(h%:doc:`/admin-guide/mm/damon/lru_sort`h]j+)}(hj$ h]h/admin-guide/mm/damon/lru_sort}(hj& hhhNhNubah}(h]h ](j6stdstd-doceh"]h$]h&]uh1j*hj" ubah}(h]h ]h"]h$]h&]refdocjC refdomainj0 reftypedoc refexplicitrefwarnjI/admin-guide/mm/damon/lru_sortuh1hhhhMhjubh).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]+special-purpose-access-aware-kernel-modulesah ]h"]+special-purpose access-aware kernel modulesah$]h&]uh1hhjhhhhhMubeh}(h](modulesjeh ]h"](modules damon_moduleseh$]h&]uh1hhhhhhhhMj^}jZ jsj`}jjsubeh}(h]designah ]h"]designah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}(h]hajB]j8ajf]j\aj]jaj]jaj]jaj:]j0aj]jajm]jcajx]jnaj ]j aj ]j aj=]j3aj8]j.aj]jaj\]jRaj]jaj]jajb]jXaj ]jajp]jfaj]jaunameids}(jd ja j[hjZjWjHjEjjBjjjsjfj\jj[jXjjjjjjj- jj, j) j@j=jj:jjjtjjsjpjjmjjj~j{j jxj j j" j j! j jj j~j{j?j=j>j;jj8jjjjjjj#j\j"jjjjjjijjhjejjbjj jj jjjvjsjjpjjjZ jjY jV jjjQ jN u nametypes}(jd j[jZjHjjjsj\j[jjjj- j, j@jjjtjsjjj~j j j" j! jj~j?j>jjjjj#j"jjjijhjjjjjvjjjZ jY jjQ uh}(ja hhhjWhjEjbjBjKjjKjfjgjjjXjjjajjjjjjj) jj=jj:jCjjCjjjpjjmjyjjyj{jjxjj jj j j j j j2 j{j2 j=j>j;j>j8jDjjDjjjjj\j]jj]jj(jj(jjjejjbjnj jnj jjjjsjjpjjjjjjV jjjjN ju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages](hsystem_message)}(hhh]h)}(hhh]hVHyperlink target "damon-design-execution-model-and-data-structures" is not referenced.}hj !sbah}(h]h ]h"]h$]h&]uh1hhj!ubah}(h]h ]h"]h$]h&]levelKtypeINFOsourcehlineKuh1j!ubj!)}(hhh]h)}(hhh]h:Hyperlink target "damon-operations-set" is not referenced.}hj$!sbah}(h]h ]h"]h$]h&]uh1hhj!!ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineK'uh1j!ubj!)}(hhh]h)}(hhh]hNHyperlink target "damon-design-configurable-operations-set" is not referenced.}hj>!sbah}(h]h ]h"]h$]h&]uh1hhj;!ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineK,uh1j!ubj!)}(hhh]h)}(hhh]hTHyperlink target "damon-design-vaddr-target-regions-construction" is not referenced.}hjX!sbah}(h]h ]h"]h$]h&]uh1hhjU!ubah}(h]h ]h"]h$]h&]levelKtypej!lineKRsourcehuh1j!ubj!)}(hhh]h)}(hhh]h6Hyperlink target "damon-core-logic" is not referenced.}hjr!sbah}(h]h ]h"]h$]h&]uh1hhjo!ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineKuh1j!ubj!)}(hhh]h)}(hhh]h=Hyperlink target "damon-design-monitoring" is not referenced.}hj!sbah}(h]h ]h"]h$]h&]uh1hhj!ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineKuh1j!ubj!)}(hhh]h)}(hhh]hHHyperlink target "damon-design-region-based-sampling" is not referenced.}hj!sbah}(h]h ]h"]h$]h&]uh1hhj!ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineKuh1j!ubj!)}(hhh]h)}(hhh]hNHyperlink target "damon-design-adaptive-regions-adjustment" is not referenced.}hj!sbah}(h]h ]h"]h$]h&]uh1hhj!ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineKuh1j!ubj!)}(hhh]h)}(hhh]h?Hyperlink target "damon-design-age-tracking" is not referenced.}hj!sbah}(h]h ]h"]h$]h&]uh1hhj!ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineKuh1j!ubj!)}(hhh]h)}(hhh]hQHyperlink target "damon-design-monitoring-params-tuning-guide" is not referenced.}hj!sbah}(h]h ]h"]h$]h&]uh1hhj!ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineM uh1j!ubj!)}(hhh]h)}(hhh]hRHyperlink target "damon-design-monitoring-intervals-autotuning" is not referenced.}hj"sbah}(h]h ]h"]h$]h&]uh1hhj "ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineMHuh1j!ubj!)}(hhh]h)}(hhh]h8Hyperlink target "damon-design-damos" is not referenced.}hj("sbah}(h]h ]h"]h$]h&]uh1hhj%"ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineMvuh1j!ubj!)}(hhh]h)}(hhh]h?Hyperlink target "damon-design-damos-action" is not referenced.}hjB"sbah}(h]h ]h"]h$]h&]uh1hhj?"ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineMuh1j!ubj!)}(hhh]h)}(hhh]hGHyperlink target "damon-design-damos-access-pattern" is not referenced.}hj\"sbah}(h]h ]h"]h$]h&]uh1hhjY"ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineMuh1j!ubj!)}(hhh]h)}(hhh]h?Hyperlink target "damon-design-damos-quotas" is not referenced.}hjv"sbah}(h]h ]h"]h$]h&]uh1hhjs"ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineMuh1j!ubj!)}(hhh]h)}(hhh]hNHyperlink target "damon-design-damos-quotas-prioritization" is not referenced.}hj"sbah}(h]h ]h"]h$]h&]uh1hhj"ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineMuh1j!ubj!)}(hhh]h)}(hhh]hKHyperlink target "damon-design-damos-quotas-auto-tuning" is not referenced.}hj"sbah}(h]h ]h"]h$]h&]uh1hhj"ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineMuh1j!ubj!)}(hhh]h)}(hhh]hCHyperlink target "damon-design-damos-watermarks" is not referenced.}hj"sbah}(h]h ]h"]h$]h&]uh1hhj"ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineM>uh1j!ubj!)}(hhh]h)}(hhh]h@Hyperlink target "damon-design-damos-filters" is not referenced.}hj"sbah}(h]h ]h"]h$]h&]uh1hhj"ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineMXuh1j!ubj!)}(hhh]h)}(hhh]h=Hyperlink target "damon-design-damos-stat" is not referenced.}hj"sbah}(h]h ]h"]h$]h&]uh1hhj"ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineMuh1j!ubj!)}(hhh]h)}(hhh]h6Hyperlink target "damon-design-api" is not referenced.}hj#sbah}(h]h ]h"]h$]h&]uh1hhj#ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineMuh1j!ubj!)}(hhh]h)}(hhh]h3Hyperlink target "damon-modules" is not referenced.}hj,#sbah}(h]h ]h"]h$]h&]uh1hhj)#ubah}(h]h ]h"]h$]h&]levelKtypej!sourcehlineMuh1j!ube transformerN include_log] decorationNhhub.