Jsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget0/translations/zh_CN/admin-guide/mm/damon/reclaimmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/zh_TW/admin-guide/mm/damon/reclaimmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/it_IT/admin-guide/mm/damon/reclaimmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/ja_JP/admin-guide/mm/damon/reclaimmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/ko_KR/admin-guide/mm/damon/reclaimmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/sp_SP/admin-guide/mm/damon/reclaimmodnameN 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:spacepreserveuh1hhhhhhJ/var/lib/git/docbuild/linux/Documentation/admin-guide/mm/damon/reclaim.rsthKubhsection)}(hhh](htitle)}(hDAMON-based Reclamationh]hDAMON-based Reclamation}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hX=DAMON-based Reclamation (DAMON_RECLAIM) is a static kernel module that aimed to be used for proactive and lightweight reclamation under light memory pressure. It doesn't aim to replace the LRU-list based page_granularity reclamation, but to be selectively used for different level of memory pressure and requirements.h]hX?DAMON-based Reclamation (DAMON_RECLAIM) is a static kernel module that aimed to be used for proactive and lightweight reclamation under light memory pressure. It doesn’t aim to replace the LRU-list based page_granularity reclamation, but to be selectively used for different level of memory pressure and requirements.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(h(Where Proactive Reclamation is Required?h]h(Where Proactive Reclamation is Required?}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh)}(hX On general memory over-committed systems, proactively reclaiming cold pages helps saving memory and reducing latency spikes that incurred by the direct reclaim of the process or CPU consumption of kswapd, while incurring only minimal performance degradation [1]_ [2]_ .h](hXOn general memory over-committed systems, proactively reclaiming cold pages helps saving memory and reducing latency spikes that incurred by the direct reclaim of the process or CPU consumption of kswapd, while incurring only minimal performance degradation }(hhhhhNhNubhfootnote_reference)}(h[1]_h]h1}(hhhhhNhNubah}(h]id1ah ]h"]h$]h&]refidid4docnameadmin-guide/mm/damon/reclaimuh1hhhresolvedKubh }(hhhhhNhNubh)}(h[2]_h]h2}(hj hhhNhNubah}(h]id2ah ]h"]h$]h&]jid5jjuh1hhhjKubh .}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXFree Pages Reporting [3]_ based memory over-commit virtualization systems are good example of the cases. In such systems, the guest VMs reports their free memory to host, and the host reallocates the reported memory to other guests. As a result, the memory of the systems are fully utilized. However, the guests could be not so memory-frugal, mainly because some kernel subsystems and user-space applications are designed to use as much memory as available. Then, guests could report only small amount of memory as free to host, results in memory utilization drop of the systems. Running the proactive reclamation in guests could mitigate this problem.h](hFree Pages Reporting }(hj&hhhNhNubh)}(h[3]_h]h3}(hj.hhhNhNubah}(h]id3ah ]h"]h$]h&]jid6jjuh1hhj&jKubhXw based memory over-commit virtualization systems are good example of the cases. In such systems, the guest VMs reports their free memory to host, and the host reallocates the reported memory to other guests. As a result, the memory of the systems are fully utilized. However, the guests could be not so memory-frugal, mainly because some kernel subsystems and user-space applications are designed to use as much memory as available. Then, guests could report only small amount of memory as free to host, results in memory utilization drop of the systems. Running the proactive reclamation in guests could mitigate this problem.}(hj&hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubeh}(h]'where-proactive-reclamation-is-requiredah ]h"](where proactive reclamation is required?ah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(h How It Works?h]h How It Works?}(hjShhhNhNubah}(h]h ]h"]h$]h&]uh1hhjPhhhhhKubh)}(hXDAMON_RECLAIM finds memory regions that didn't accessed for specific time duration and page out. To avoid it consuming too much CPU for the paging out operation, a speed limit can be configured. Under the speed limit, it pages out memory regions that didn't accessed longer time first. System administrators can also configure under what situation this scheme should automatically activated and deactivated with three memory pressure watermarks.h]hXDAMON_RECLAIM finds memory regions that didn’t accessed for specific time duration and page out. To avoid it consuming too much CPU for the paging out operation, a speed limit can be configured. Under the speed limit, it pages out memory regions that didn’t accessed longer time first. System administrators can also configure under what situation this scheme should automatically activated and deactivated with three memory pressure watermarks.}(hjahhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK!hjPhhubeh}(h] how-it-worksah ]h"] how it works?ah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hInterface: Module Parametersh]hInterface: Module Parameters}(hjzhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjwhhhhhK)ubh)}(h~To use this feature, you should first ensure your system is running on a kernel that is built with ``CONFIG_DAMON_RECLAIM=y``.h](hcTo use this feature, you should first ensure your system is running on a kernel that is built with }(hjhhhNhNubhliteral)}(h``CONFIG_DAMON_RECLAIM=y``h]hCONFIG_DAMON_RECLAIM=y}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK+hjwhhubh)}(hX To let sysadmins enable or disable it and tune for the given system, DAMON_RECLAIM utilizes module parameters. That is, you can put ``damon_reclaim.=`` on the kernel boot command line or write proper values to ``/sys/module/damon_reclaim/parameters/`` files.h](hTo let sysadmins enable or disable it and tune for the given system, DAMON_RECLAIM utilizes module parameters. That is, you can put }(hjhhhNhNubj)}(h%``damon_reclaim.=``h]h!damon_reclaim.=}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh; on the kernel boot command line or write proper values to }(hjhhhNhNubj)}(h4``/sys/module/damon_reclaim/parameters/``h]h0/sys/module/damon_reclaim/parameters/}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh files.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK.hjwhhubh)}(h,Below are the description of each parameter.h]h,Below are the description of each parameter.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjwhhubh)}(hhh](h)}(henabledh]henabled}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK6ubh)}(h Enable or disable DAMON_RECLAIM.h]h Enable or disable DAMON_RECLAIM.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hjhhubh)}(hX3You can enable DAMON_RCLAIM by setting the value of this parameter as ``Y``. Setting it as ``N`` disables DAMON_RECLAIM. Note that DAMON_RECLAIM could do no real monitoring and reclamation due to the watermarks-based activation condition. Refer to below descriptions for the watermarks parameter for this.h](hFYou can enable DAMON_RCLAIM by setting the value of this parameter as }(hj hhhNhNubj)}(h``Y``h]hY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh. Setting it as }(hj hhhNhNubj)}(h``N``h]hN}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh disables DAMON_RECLAIM. Note that DAMON_RECLAIM could do no real monitoring and reclamation due to the watermarks-based activation condition. Refer to below descriptions for the watermarks parameter for this.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK:hjhhubeh}(h]enabledah ]h"]enabledah$]h&]uh1hhjwhhhhhK6ubh)}(hhh](h)}(h commit_inputsh]h commit_inputs}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjChhhhhK@ubh)}(hHMake DAMON_RECLAIM reads the input parameters again, except ``enabled``.h](h min_age # echo $((1 * 1024 * 1024 * 1024)) > quota_sz # echo 1000 > quota_reset_interval_ms # echo 500 > wmarks_high # echo 400 > wmarks_mid # echo 200 > wmarks_low # echo Y > enabledh]h# cd /sys/module/damon_reclaim/parameters # echo 30000000 > min_age # echo $((1 * 1024 * 1024 * 1024)) > quota_sz # 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&]hhuh1jhhhM"hjyhhubhfootnote)}(h&https://research.google/pubs/pub48551/h](hlabel)}(h1h]h1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hjh]h reference)}(hjh]h&https://research.google/pubs/pub48551/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhM+hjubeh}(h]jah ]h"]1ah$]h&]hajjuh1jhhhM+hjyhhjKubj)}(h https://lwn.net/Articles/787611/h](j)}(h2h]h2}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh)}(hjh]j)}(hjh]h https://lwn.net/Articles/787611/}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurijuh1jhjubah}(h]h ]h"]h$]h&]uh1hhhhM,hjubeh}(h]jah ]h"]2ah$]h&]jajjuh1jhhhM,hjyhhjKubj)}(hBhttps://www.kernel.org/doc/html/latest/mm/free_page_reporting.htmlh](j)}(h3h]h3}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj ubh)}(hj h]j)}(hj h]hBhttps://www.kernel.org/doc/html/latest/mm/free_page_reporting.html}(hj# hhhNhNubah}(h]h ]h"]h$]h&]refurij uh1jhj ubah}(h]h ]h"]h$]h&]uh1hhhhM-hj ubeh}(h]j=ah ]h"]3ah$]h&]j8ajjuh1jhhhM-hjyhhjKubeh}(h]exampleah ]h"]exampleah$]h&]uh1hhhhhhhhMubeh}(h]damon-based-reclamationah ]h"]damon-based reclamationah$]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_handlerjq 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}(1]ha2]j a3]j.aurefids}nameids}(jK jH jMjJjtjqjvjsj@j=jjjjjCj@jjjjj0j-jjjjjjjjjKjHjjjjjZjWjjjjjjjvjsjjjjjjj jjGjDjnjkjC j@ jjj jj; j=u nametypes}(jK jMjtjvj@jjjCjjj0jjjjjKjjjZjjjjvjjjj jGjnjC jj j; uh}(jH hjJhhhjj j8j.jqjPjsjwj=jjjCjjj@jjjFjjj-jjj3jjjjjjjHjjjNjjjWjjj]jjjjjsj jjyjjjjjjjDj#jkjJj@ jyjjjjj=j u footnote_refs}(j ]haj ]j aj ]j.au citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes](jjj e citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}j KsRparse_messages]transform_messages] transformerN include_log] decorationNhhub.