ٕsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget1/translations/zh_CN/admin-guide/mm/damon/lru_sortmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/zh_TW/admin-guide/mm/damon/lru_sortmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/it_IT/admin-guide/mm/damon/lru_sortmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/ja_JP/admin-guide/mm/damon/lru_sortmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/ko_KR/admin-guide/mm/damon/lru_sortmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget1/translations/sp_SP/admin-guide/mm/damon/lru_sortmodnameN 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:spacepreserveuh1hhhhhhK/var/lib/git/docbuild/linux/Documentation/admin-guide/mm/damon/lru_sort.rsthKubhsection)}(hhh](htitle)}(hDAMON-based LRU-lists Sortingh]hDAMON-based LRU-lists Sorting}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hXDAMON-based LRU-lists Sorting (DAMON_LRU_SORT) is a static kernel module that aimed to be used for proactive and lightweight data access pattern based (de)prioritization of pages on their LRU-lists for making LRU-lists a more trusworthy data access pattern source.h]hXDAMON-based LRU-lists Sorting (DAMON_LRU_SORT) is a static kernel module that aimed to be used for proactive and lightweight data access pattern based (de)prioritization of pages on their LRU-lists for making LRU-lists a more trusworthy data access pattern source.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(h.Where Proactive LRU-lists Sorting is Required?h]h.Where Proactive LRU-lists Sorting is Required?}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh)}(hXAs page-granularity access checking overhead could be significant on huge systems, LRU lists are normally not proactively sorted but partially and reactively sorted for special events including specific user requests, system calls and memory pressure. As a result, LRU lists are sometimes not so perfectly prepared to be used as a trustworthy access pattern source for some situations including reclamation target pages selection under sudden memory pressure.h]hXAs page-granularity access checking overhead could be significant on huge systems, LRU lists are normally not proactively sorted but partially and reactively sorted for special events including specific user requests, system calls and memory pressure. As a result, LRU lists are sometimes not so perfectly prepared to be used as a trustworthy access pattern source for some situations including reclamation target pages selection under sudden memory pressure.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hX Because DAMON can identify access patterns of best-effort accuracy while inducing only user-specified range of overhead, proactively running DAMON_LRU_SORT could be helpful for making LRU lists more trustworthy access pattern source with low and controlled overhead.h]hX Because DAMON can identify access patterns of best-effort accuracy while inducing only user-specified range of overhead, proactively running DAMON_LRU_SORT could be helpful for making LRU lists more trustworthy access pattern source with low and controlled overhead.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h]-where-proactive-lru-lists-sorting-is-requiredah ]h"].where proactive lru-lists sorting is required?ah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(h How It Works?h]h How It Works?}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hXDAMON_LRU_SORT finds hot pages (pages of memory regions that showing access rates that higher than a user-specified threshold) and cold pages (pages of memory regions that showing no access for a time that longer than a user-specified threshold) using DAMON, and prioritizes hot pages while deprioritizing cold pages on their LRU-lists. To avoid it consuming too much CPU for the prioritizations, a CPU time usage limit can be configured. Under the limit, it prioritizes and deprioritizes more hot and cold pages first, respectively. System administrators can also configure under what situation this scheme should automatically activated and deactivated with three memory pressure watermarks.h]hXDAMON_LRU_SORT finds hot pages (pages of memory regions that showing access rates that higher than a user-specified threshold) and cold pages (pages of memory regions that showing no access for a time that longer than a user-specified threshold) using DAMON, and prioritizes hot pages while deprioritizing cold pages on their LRU-lists. To avoid it consuming too much CPU for the prioritizations, a CPU time usage limit can be configured. Under the limit, it prioritizes and deprioritizes more hot and cold pages first, respectively. System administrators can also configure under what situation this scheme should automatically activated and deactivated with three memory pressure watermarks.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hXuIts default parameters for hotness/coldness thresholds and CPU quota limit are conservatively chosen. That is, the module under its default parameters could be widely used without harm for common situations while providing a level of benefits for systems having clear hot/cold access patterns under memory pressure while consuming only a limited small portion of CPU time.h]hXuIts default parameters for hotness/coldness thresholds and CPU quota limit are conservatively chosen. That is, the module under its default parameters could be widely used without harm for common situations while providing a level of benefits for systems having clear hot/cold access patterns under memory pressure while consuming only a limited small portion of CPU time.}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hjhhubeh}(h] how-it-worksah ]h"] how it works?ah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hInterface: Module Parametersh]hInterface: Module Parameters}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjChhhhhK1ubh)}(hTo use this feature, you should first ensure your system is running on a kernel that is built with ``CONFIG_DAMON_LRU_SORT=y``.h](hcTo use this feature, you should first ensure your system is running on a kernel that is built with }(hjThhhNhNubhliteral)}(h``CONFIG_DAMON_LRU_SORT=y``h]hCONFIG_DAMON_LRU_SORT=y}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1j\hjTubh.}(hjThhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK3hjChhubh)}(hX#To let sysadmins enable or disable it and tune for the given system, DAMON_LRU_SORT utilizes module parameters. That is, you can put ``damon_lru_sort.=`` on the kernel boot command line or write proper values to ``/sys/module/damon_lru_sort/parameters/`` files.h](hTo let sysadmins enable or disable it and tune for the given system, DAMON_LRU_SORT utilizes module parameters. That is, you can put }(hjvhhhNhNubj])}(h&``damon_lru_sort.=``h]h"damon_lru_sort.=}(hj~hhhNhNubah}(h]h ]h"]h$]h&]uh1j\hjvubh; on the kernel boot command line or write proper values to }(hjvhhhNhNubj])}(h5``/sys/module/damon_lru_sort/parameters/``h]h1/sys/module/damon_lru_sort/parameters/}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j\hjvubh files.}(hjvhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK6hjChhubh)}(h,Below are the description of each parameter.h]h,Below are the description of each parameter.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjChhubh)}(hhh](h)}(henabledh]henabled}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK>ubh)}(h!Enable or disable DAMON_LRU_SORT.h]h!Enable or disable DAMON_LRU_SORT.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK@hjhhubh)}(hX=You can enable DAMON_LRU_SORT by setting the value of this parameter as ``Y``. Setting it as ``N`` disables DAMON_LRU_SORT. Note that DAMON_LRU_SORT could do no real monitoring and LRU-lists sorting due to the watermarks-based activation condition. Refer to below descriptions for the watermarks parameter for this.h](hHYou can enable DAMON_LRU_SORT by setting the value of this parameter as }(hjhhhNhNubj])}(h``Y``h]hY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j\hjubh. Setting it as }(hjhhhNhNubj])}(h``N``h]hN}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1j\hjubh disables DAMON_LRU_SORT. Note that DAMON_LRU_SORT could do no real monitoring and LRU-lists sorting due to the watermarks-based activation condition. Refer to below descriptions for the watermarks parameter for this.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKBhjhhubeh}(h]enabledah ]h"]enabledah$]h&]uh1hhjChhhhhK>ubh)}(hhh](h)}(h commit_inputsh]h commit_inputs}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKHubh)}(hIMake DAMON_LRU_SORT reads the input parameters again, except ``enabled``.h](h=Make DAMON_LRU_SORT reads the input parameters again, except }(hj hhhNhNubj])}(h ``enabled``h]henabled}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1j\hj ubh.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKJhjhhubh)}(hXXInput parameters that updated while DAMON_LRU_SORT is running are not applied by default. Once this parameter is set as ``Y``, DAMON_LRU_SORT reads values of parametrs except ``enabled`` again. Once the re-reading is done, this parameter is set as ``N``. If invalid parameters are found while the re-reading, DAMON_LRU_SORT will be disabled.h](hyInput parameters that updated while DAMON_LRU_SORT is running are not applied by default. Once this parameter is set as }(hj@hhhNhNubj])}(h``Y``h]hY}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1j\hj@ubh2, DAMON_LRU_SORT reads values of parametrs except }(hj@hhhNhNubj])}(h ``enabled``h]henabled}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1j\hj@ubh? again. Once the re-reading is done, this parameter is set as }(hj@hhhNhNubj])}(h``N``h]hN}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1j\hj@ubhY. If invalid parameters are found while the re-reading, DAMON_LRU_SORT will be disabled.}(hj@hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKLhjhhubeh}(h] commit-inputsah ]h"] commit_inputsah$]h&]uh1hhjChhhhhKHubh)}(hhh](h)}(hhot_thres_access_freqh]hhot_thres_access_freq}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKSubh)}(hKAccess frequency threshold for hot memory regions identification in permil.h]hKAccess frequency threshold for hot memory regions identification in permil.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKUhjhhubh)}(hIf a memory region is accessed in frequency of this or higher, DAMON_LRU_SORT identifies the region as hot, and mark it as accessed on the LRU list, so that it could not be reclaimed under memory pressure. 50% by default.h]hIf a memory region is accessed in frequency of this or higher, DAMON_LRU_SORT identifies the region as hot, and mark it as accessed on the LRU list, so that it could not be reclaimed under memory pressure. 50% by default.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKWhjhhubeh}(h]hot-thres-access-freqah ]h"]hot_thres_access_freqah$]h&]uh1hhjChhhhhKSubh)}(hhh](h)}(h cold_min_ageh]h cold_min_age}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK\ubh)}(hFTime threshold for cold memory regions identification in microseconds.h]hFTime threshold for cold memory regions identification in microseconds.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK^hjhhubh)}(hIf a memory region is not accessed for this or longer time, DAMON_LRU_SORT identifies the region as cold, and mark it as unaccessed on the LRU list, so that it could be reclaimed first under memory pressure. 120 seconds by default.h]hIf a memory region is not accessed for this or longer time, DAMON_LRU_SORT identifies the region as cold, and mark it as unaccessed on the LRU list, so that it could be reclaimed first under memory pressure. 120 seconds by default.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK`hjhhubeh}(h] cold-min-ageah ]h"] cold_min_ageah$]h&]uh1hhjChhhhhK\ubh)}(hhh](h)}(hquota_msh]hquota_ms}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKfubh)}(h?Limit of time for trying the LRU lists sorting in milliseconds.h]h?Limit of time for trying the LRU lists sorting in milliseconds.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhjhhubh)}(hDAMON_LRU_SORT tries to use only up to this time within a time window (quota_reset_interval_ms) for trying LRU lists sorting. This can be used for limiting CPU consumption of DAMON_LRU_SORT. If the value is zero, the limit is disabled.h]hDAMON_LRU_SORT tries to use only up to this time within a time window (quota_reset_interval_ms) for trying LRU lists sorting. This can be used for limiting CPU consumption of DAMON_LRU_SORT. If the value is zero, the limit is disabled.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKjhjhhubh)}(h10 ms by default.h]h10 ms by default.}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohjhhubeh}(h]quota-msah ]h"]quota_msah$]h&]uh1hhjChhhhhKfubh)}(hhh](h)}(hquota_reset_interval_msh]hquota_reset_interval_ms}(hj<hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9hhhhhKrubh)}(h5The time quota charge reset interval in milliseconds.h]h5The time quota charge reset interval in milliseconds.}(hjJhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKthj9hhubh)}(hThe charge reset interval for the quota of time (quota_ms). That is, DAMON_LRU_SORT does not try LRU-lists sorting for more than quota_ms milliseconds or quota_sz bytes within quota_reset_interval_ms milliseconds.h]hThe charge reset interval for the quota of time (quota_ms). That is, DAMON_LRU_SORT does not try LRU-lists sorting for more than quota_ms milliseconds or quota_sz bytes within quota_reset_interval_ms milliseconds.}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKvhj9hhubh)}(h1 second by default.h]h1 second by default.}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKzhj9hhubeh}(h]quota-reset-interval-msah ]h"]quota_reset_interval_msah$]h&]uh1hhjChhhhhKrubh)}(hhh](h)}(hwmarks_intervalh]hwmarks_interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhj|hhhhhK}ubh)}(h3The watermarks check time interval in microseconds.h]h3The watermarks check time interval in microseconds.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj|hhubh)}(hMinimal time to wait before checking the watermarks, when DAMON_LRU_SORT is enabled but inactive due to its watermarks rule. 5 seconds by default.h]hMinimal time to wait before checking the watermarks, when DAMON_LRU_SORT is enabled but inactive due to its watermarks rule. 5 seconds by default.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj|hhubeh}(h]wmarks-intervalah ]h"]wmarks_intervalah$]h&]uh1hhjChhhhhK}ubh)}(hhh](h)}(h wmarks_highh]h wmarks_high}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h7Free memory rate (per thousand) for the high watermark.h]h7Free memory rate (per thousand) for the high watermark.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hIf free memory of the system in bytes per thousand bytes is higher than this, DAMON_LRU_SORT becomes inactive, so it does nothing but periodically checks the watermarks. 200 (20%) by default.h]hIf free memory of the system in bytes per thousand bytes is higher than this, DAMON_LRU_SORT becomes inactive, so it does nothing but periodically checks the watermarks. 200 (20%) by default.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h] wmarks-highah ]h"] wmarks_highah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(h wmarks_midh]h wmarks_mid}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h9Free memory rate (per thousand) for the middle watermark.h]h9Free memory rate (per thousand) for the middle watermark.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hIf free memory of the system in bytes per thousand bytes is between this and the low watermark, DAMON_LRU_SORT becomes active, so starts the monitoring and the LRU-lists sorting. 150 (15%) by default.h]hIf free memory of the system in bytes per thousand bytes is between this and the low watermark, DAMON_LRU_SORT becomes active, so starts the monitoring and the LRU-lists sorting. 150 (15%) by default.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h] wmarks-midah ]h"] wmarks_midah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(h wmarks_lowh]h wmarks_low}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h6Free memory rate (per thousand) for the low watermark.h]h6Free memory rate (per thousand) for the low watermark.}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hIf free memory of the system in bytes per thousand bytes is lower than this, DAMON_LRU_SORT becomes inactive, so it does nothing but periodically checks the watermarks. 50 (5%) by default.h]hIf free memory of the system in bytes per thousand bytes is lower than this, DAMON_LRU_SORT becomes inactive, so it does nothing but periodically checks the watermarks. 50 (5%) by default.}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h] wmarks-lowah ]h"] wmarks_lowah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(hsample_intervalh]hsample_interval}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhjPhhhhhKubh)}(h5Sampling interval for the monitoring in microseconds.h]h5Sampling interval for the monitoring in microseconds.}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjPhhubh)}(hThe sampling interval of DAMON for the cold memory monitoring. Please refer to the DAMON documentation (:doc:`usage`) for more detail. 5ms by default.h](hiThe sampling interval of DAMON for the cold memory monitoring. Please refer to the DAMON documentation (}(hjohhhNhNubh)}(h :doc:`usage`h]hinline)}(hjyh]husage}(hj}hhhNhNubah}(h]h ](xrefstdstd-doceh"]h$]h&]uh1j{hjwubah}(h]h ]h"]h$]h&]refdocadmin-guide/mm/damon/lru_sort refdomainjreftypedoc refexplicitrefwarn reftargetusageuh1hhhhKhjoubh#) for more detail. 5ms by default.}(hjohhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjPhhubeh}(h]sample-intervalah ]h"]sample_intervalah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(h aggr_intervalh]h aggr_interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h8Aggregation interval for the monitoring in microseconds.h]h8Aggregation interval for the monitoring in microseconds.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThe aggregation interval of DAMON for the cold memory monitoring. Please refer to the DAMON documentation (:doc:`usage`) for more detail. 100ms by default.h](hlThe aggregation interval of DAMON for the cold memory monitoring. Please refer to the DAMON documentation (}(hjhhhNhNubh)}(h :doc:`usage`h]j|)}(hjh]husage}(hjhhhNhNubah}(h]h ](jstdstd-doceh"]h$]h&]uh1j{hjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypedoc refexplicitrefwarnjusageuh1hhhhKhjubh%) for more detail. 100ms by default.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h] aggr-intervalah ]h"] aggr_intervalah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(hmin_nr_regionsh]hmin_nr_regions}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h%Minimum number of monitoring regions.h]h%Minimum number of monitoring regions.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hX3The minimal number of monitoring regions of DAMON for the cold memory monitoring. This can be used to set lower-bound of the monitoring quality. But, setting this too high could result in increased monitoring overhead. Please refer to the DAMON documentation (:doc:`usage`) for more detail. 10 by default.h](hXThe minimal number of monitoring regions of DAMON for the cold memory monitoring. This can be used to set lower-bound of the monitoring quality. But, setting this too high could result in increased monitoring overhead. Please refer to the DAMON documentation (}(hj&hhhNhNubh)}(h :doc:`usage`h]j|)}(hj0h]husage}(hj2hhhNhNubah}(h]h ](jstdstd-doceh"]h$]h&]uh1j{hj.ubah}(h]h ]h"]h$]h&]refdocj refdomainj<reftypedoc refexplicitrefwarnjusageuh1hhhhKhj&ubh") for more detail. 10 by default.}(hj&hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]min-nr-regionsah ]h"]min_nr_regionsah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(hmax_nr_regionsh]hmax_nr_regions}(hjchhhNhNubah}(h]h ]h"]h$]h&]uh1hhj`hhhhhKubh)}(h%Maximum number of monitoring regions.h]h%Maximum number of monitoring regions.}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj`hhubh)}(hX4The maximum number of monitoring regions of DAMON for the cold memory monitoring. This can be used to set upper-bound of the monitoring overhead. However, setting this too low could result in bad monitoring quality. Please refer to the DAMON documentation (:doc:`usage`) for more detail. 1000 by defaults.h](hXThe maximum number of monitoring regions of DAMON for the cold memory monitoring. This can be used to set upper-bound of the monitoring overhead. However, setting this too low could result in bad monitoring quality. Please refer to the DAMON documentation (}(hjhhhNhNubh)}(h :doc:`usage`h]j|)}(hjh]husage}(hjhhhNhNubah}(h]h ](jstdstd-doceh"]h$]h&]uh1j{hjubah}(h]h ]h"]h$]h&]refdocj refdomainjreftypedoc refexplicitrefwarnjusageuh1hhhhKhjubh%) for more detail. 1000 by defaults.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj`hhubeh}(h]max-nr-regionsah ]h"]max_nr_regionsah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(hmonitor_region_starth]hmonitor_region_start}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h2Start of target memory region in physical address.h]h2Start of target memory region in physical address.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThe start physical address of memory region that DAMON_LRU_SORT will do work against. By default, biggest System RAM is used as the region.h]hThe start physical address of memory region that DAMON_LRU_SORT will do work against. By default, biggest System RAM is used as the region.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]monitor-region-startah ]h"]monitor_region_startah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(hmonitor_region_endh]hmonitor_region_end}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h0End of target memory region in physical address.h]h0End of target memory region in physical address.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThe end physical address of memory region that DAMON_LRU_SORT will do work against. By default, biggest System RAM is used as the region.h]hThe end physical address of memory region that DAMON_LRU_SORT will do work against. By default, biggest System RAM is used as the region.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]monitor-region-endah ]h"]monitor_region_endah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(h kdamond_pidh]h kdamond_pid}(hj&hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj#hhhhhKubh)}(hPID of the DAMON thread.h]hPID of the DAMON thread.}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj#hhubh)}(hSIf DAMON_LRU_SORT is enabled, this becomes the PID of the worker thread. Else, -1.h]hSIf DAMON_LRU_SORT is enabled, this becomes the PID of the worker thread. Else, -1.}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj#hhubeh}(h] kdamond-pidah ]h"] kdamond_pidah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(hnr_lru_sort_tried_hot_regionsh]hnr_lru_sort_tried_hot_regions}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjXhhhhhKubh)}(h9Number of hot memory regions that tried to be LRU-sorted.h]h9Number of hot memory regions that tried to be LRU-sorted.}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjXhhubeh}(h]nr-lru-sort-tried-hot-regionsah ]h"]nr_lru_sort_tried_hot_regionsah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(h bytes_lru_sort_tried_hot_regionsh]h bytes_lru_sort_tried_hot_regions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h>Total bytes of hot memory regions that tried to be LRU-sorted.h]h>Total bytes of hot memory regions that tried to be LRU-sorted.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h] bytes-lru-sort-tried-hot-regionsah ]h"] bytes_lru_sort_tried_hot_regionsah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(hnr_lru_sorted_hot_regionsh]hnr_lru_sorted_hot_regions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h=Number of hot memory regions that successfully be LRU-sorted.h]h=Number of hot memory regions that successfully be LRU-sorted.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]nr-lru-sorted-hot-regionsah ]h"]nr_lru_sorted_hot_regionsah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(hbytes_lru_sorted_hot_regionsh]hbytes_lru_sorted_hot_regions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hBTotal bytes of hot memory regions that successfully be LRU-sorted.h]hBTotal bytes of hot memory regions that successfully be LRU-sorted.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]bytes-lru-sorted-hot-regionsah ]h"]bytes_lru_sorted_hot_regionsah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(hnr_hot_quota_exceedsh]hnr_hot_quota_exceeds}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hHNumber of times that the time quota limit for hot regions have exceeded.h]hHNumber of times that the time quota limit for hot regions have exceeded.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]nr-hot-quota-exceedsah ]h"]nr_hot_quota_exceedsah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(hnr_lru_sort_tried_cold_regionsh]hnr_lru_sort_tried_cold_regions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h:Number of cold memory regions that tried to be LRU-sorted.h]h:Number of cold memory regions that tried to be LRU-sorted.}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]nr-lru-sort-tried-cold-regionsah ]h"]nr_lru_sort_tried_cold_regionsah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(h!bytes_lru_sort_tried_cold_regionsh]h!bytes_lru_sort_tried_cold_regions}(hjEhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjBhhhhhKubh)}(h?Total bytes of cold memory regions that tried to be LRU-sorted.h]h?Total bytes of cold memory regions that tried to be LRU-sorted.}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjBhhubeh}(h]!bytes-lru-sort-tried-cold-regionsah ]h"]!bytes_lru_sort_tried_cold_regionsah$]h&]uh1hhjChhhhhKubh)}(hhh](h)}(hnr_lru_sorted_cold_regionsh]hnr_lru_sorted_cold_regions}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjihhhhhMubh)}(h>Number of cold memory regions that successfully be LRU-sorted.h]h>Number of cold memory regions that successfully be LRU-sorted.}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjihhubeh}(h]nr-lru-sorted-cold-regionsah ]h"]nr_lru_sorted_cold_regionsah$]h&]uh1hhjChhhhhMubh)}(hhh](h)}(hbytes_lru_sorted_cold_regionsh]hbytes_lru_sorted_cold_regions}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hCTotal bytes of cold memory regions that successfully be LRU-sorted.h]hCTotal bytes of cold memory regions that successfully be LRU-sorted.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhM hjhhubeh}(h]bytes-lru-sorted-cold-regionsah ]h"]bytes_lru_sorted_cold_regionsah$]h&]uh1hhjChhhhhMubh)}(hhh](h)}(hnr_cold_quota_exceedsh]hnr_cold_quota_exceeds}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhM ubh)}(hINumber of times that the time quota limit for cold regions have exceeded.h]hINumber of times that the time quota limit for cold regions have exceeded.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubeh}(h]nr-cold-quota-exceedsah ]h"]nr_cold_quota_exceedsah$]h&]uh1hhjChhhhhM ubeh}(h]interface-module-parametersah ]h"]interface: module parametersah$]h&]uh1hhhhhhhhK1ubh)}(hhh](h)}(hExampleh]hExample}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhMubh)}(hXBelow runtime example commands make DAMON_LRU_SORT to find memory regions having >=50% access frequency and LRU-prioritize while LRU-deprioritizing memory regions that not accessed for 120 seconds. The prioritization and deprioritization is limited to be done using only up to 1% CPU time to avoid DAMON_LRU_SORT consuming too much CPU time for the (de)prioritization. It also asks DAMON_LRU_SORT to do nothing if the system's free memory rate is more than 50%, but start the real works if it becomes lower than 40%. If DAMON_RECLAIM doesn't make progress and therefore the free memory rate becomes lower than 20%, it asks DAMON_LRU_SORT to do nothing again, so that we can fall back to the LRU-list based page granularity reclamation. ::h]hXBelow runtime example commands make DAMON_LRU_SORT to find memory regions having >=50% access frequency and LRU-prioritize while LRU-deprioritizing memory regions that not accessed for 120 seconds. The prioritization and deprioritization is limited to be done using only up to 1% CPU time to avoid DAMON_LRU_SORT consuming too much CPU time for the (de)prioritization. It also asks DAMON_LRU_SORT to do nothing if the system’s free memory rate is more than 50%, but start the real works if it becomes lower than 40%. If DAMON_RECLAIM doesn’t make progress and therefore the free memory rate becomes lower than 20%, it asks DAMON_LRU_SORT to do nothing again, so that we can fall back to the LRU-list based page granularity reclamation.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhMhjhhubh literal_block)}(hX# cd /sys/module/damon_lru_sort/parameters # echo 500 > hot_thres_access_freq # echo 120000000 > cold_min_age # echo 10 > quota_ms # echo 1000 > quota_reset_interval_ms # echo 500 > wmarks_high # echo 400 > wmarks_mid # echo 200 > wmarks_low # echo Y > enabledh]hX# cd /sys/module/damon_lru_sort/parameters # echo 500 > hot_thres_access_freq # echo 120000000 > cold_min_age # echo 10 > quota_ms # echo 1000 > quota_reset_interval_ms # echo 500 > wmarks_high # echo 400 > wmarks_mid # echo 200 > wmarks_low # echo Y > enabled}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhMhjhhubeh}(h]exampleah ]h"]exampleah$]h&]uh1hhhhhhhhMubeh}(h]damon-based-lru-lists-sortingah ]h"]damon-based lru-lists sortingah$]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_handlerjHerror_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}nameids}(j"jj jj@j=jjj j jjjjjjj6j3jyjvjjjjjjjMjJjjjjj]jZjjjjj jjUjRj|jyjjjjjjjjj?j<jfjcjjjjjjjju nametypes}(j"j j@jj jjjj6jyjjjjMjjj]jjj jUj|jjjjj?jfjjjjuh}(jhjhj=jjjCj jjjjjjjj3jjvj9jj|jjjjjJjjjPjjjZjjj`jjjjjRj#jyjXjjjjjjjjj<jjcjBjjijjjjjju 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] transformerN include_log] decorationNhhub.