€•¶,Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ5/translations/zh_CN/driver-api/cxl/allocation/reclaim”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/zh_TW/driver-api/cxl/allocation/reclaim”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/it_IT/driver-api/cxl/allocation/reclaim”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/ja_JP/driver-api/cxl/allocation/reclaim”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/ko_KR/driver-api/cxl/allocation/reclaim”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ5/translations/sp_SP/driver-api/cxl/allocation/reclaim”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh£sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1h¡hhhžhhŸŒO/var/lib/git/docbuild/linux/Documentation/driver-api/cxl/allocation/reclaim.rst”h KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒReclaim”h]”hŒReclaim”…””}”(hh»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hh¶hžhhŸh³h KubhŒ paragraph”“”)”}”(hŒåAnother way CXL memory can be utilized *indirectly* is via the reclaim system in :code:`mm/vmscan.c`. Reclaim is engaged when memory capacity on the system becomes pressured based on global and cgroup-local `watermark` settings.”h]”(hŒ'Another way CXL memory can be utilized ”…””}”(hhËhžhhŸNh NubhŒemphasis”“”)”}”(hŒ *indirectly*”h]”hŒ indirectly”…””}”(hhÕhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÓhhËubhŒ is via the reclaim system in ”…””}”(hhËhžhhŸNh NubhŒliteral”“”)”}”(hŒ:code:`mm/vmscan.c`”h]”hŒ mm/vmscan.c”…””}”(hhéhžhhŸNh Nubah}”(h]”h ]”Œcode”ah"]”h$]”h&]”Œlanguage”huh1hçhhËubhŒl. Reclaim is engaged when memory capacity on the system becomes pressured based on global and cgroup-local ”…””}”(hhËhžhhŸNh NubhŒtitle_reference”“”)”}”(hŒ `watermark`”h]”hŒ watermark”…””}”(hhÿhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhhËubhŒ settings.”…””}”(hhËhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khh¶hžhubhÊ)”}”(hŒ‰In this section we won't discuss the `watermark` configurations, just how CXL memory can be consumed by various pieces of reclaim system.”h]”(hŒ'In this section we won’t discuss the ”…””}”(hjhžhhŸNh Nubhþ)”}”(hŒ `watermark`”h]”hŒ watermark”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýhjubhŒY configurations, just how CXL memory can be consumed by various pieces of reclaim system.”…””}”(hjhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K hh¶hžhubhµ)”}”(hhh]”(hº)”}”(hŒDemotion”h]”hŒDemotion”…””}”(hj:hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj7hžhhŸh³h KubhÊ)”}”(hŒñBy default, the reclaim system will prefer swap (or zswap) when reclaiming memory. Enabling :code:`kernel/mm/numa/demotion_enabled` will cause vmscan to opportunistically prefer distant NUMA nodes to swap or zswap, if capacity is available.”h]”(hŒ]By default, the reclaim system will prefer swap (or zswap) when reclaiming memory. Enabling ”…””}”(hjHhžhhŸNh Nubhè)”}”(hŒ':code:`kernel/mm/numa/demotion_enabled`”h]”hŒkernel/mm/numa/demotion_enabled”…””}”(hjPhžhhŸNh Nubah}”(h]”h ]”hôah"]”h$]”h&]”Œlanguage”huh1hçhjHubhŒm will cause vmscan to opportunistically prefer distant NUMA nodes to swap or zswap, if capacity is available.”…””}”(hjHhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khj7hžhubhÊ)”}”(hŒ³Demotion engages the :code:`mm/memory_tier.c` component to determine the next demotion node. The next demotion node is based on the :code:`HMAT` or :code:`CDAT` performance data.”h]”(hŒDemotion engages the ”…””}”(hjihžhhŸNh Nubhè)”}”(hŒ:code:`mm/memory_tier.c`”h]”hŒmm/memory_tier.c”…””}”(hjqhžhhŸNh Nubah}”(h]”h ]”hôah"]”h$]”h&]”Œlanguage”huh1hçhjiubhŒX component to determine the next demotion node. The next demotion node is based on the ”…””}”(hjihžhhŸNh Nubhè)”}”(hŒ :code:`HMAT`”h]”hŒHMAT”…””}”(hj„hžhhŸNh Nubah}”(h]”h ]”hôah"]”h$]”h&]”Œlanguage”huh1hçhjiubhŒ or ”…””}”(hjihžhhŸNh Nubhè)”}”(hŒ :code:`CDAT`”h]”hŒCDAT”…””}”(hj—hžhhŸNh Nubah}”(h]”h ]”hôah"]”h$]”h&]”Œlanguage”huh1hçhjiubhŒ performance data.”…””}”(hjihžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khj7hžhubhµ)”}”(hhh]”(hº)”}”(hŒcpusets.mems_allowed quirk”h]”hŒcpusets.mems_allowed quirk”…””}”(hj³hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj°hžhhŸh³h KubhÊ)”}”(hŒêIn Linux v6.15 and below, demotion does not respect :code:`cpusets.mems_allowed` when migrating pages. As a result, if demotion is enabled, vmscan cannot guarantee isolation of a container's memory from nodes not set in mems_allowed.”h]”(hŒ4In Linux v6.15 and below, demotion does not respect ”…””}”(hjÁhžhhŸNh Nubhè)”}”(hŒ:code:`cpusets.mems_allowed`”h]”hŒcpusets.mems_allowed”…””}”(hjÉhžhhŸNh Nubah}”(h]”h ]”hôah"]”h$]”h&]”Œlanguage”huh1hçhjÁubhŒœ when migrating pages. As a result, if demotion is enabled, vmscan cannot guarantee isolation of a container’s memory from nodes not set in mems_allowed.”…””}”(hjÁhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khj°hžhubhÊ)”}”(hXMIn Linux v6.XX and up, demotion does attempt to respect :code:`cpusets.mems_allowed`; however, certain classes of shared memory originally instantiated by another cgroup (such as common libraries - e.g. libc) may still be demoted. As a result, the mems_allowed interface still cannot provide perfect isolation from the remote nodes.”h]”(hŒ8In Linux v6.XX and up, demotion does attempt to respect ”…””}”(hjâhžhhŸNh Nubhè)”}”(hŒ:code:`cpusets.mems_allowed`”h]”hŒcpusets.mems_allowed”…””}”(hjêhžhhŸNh Nubah}”(h]”h ]”hôah"]”h$]”h&]”Œlanguage”huh1hçhjâubhŒù; however, certain classes of shared memory originally instantiated by another cgroup (such as common libraries - e.g. libc) may still be demoted. As a result, the mems_allowed interface still cannot provide perfect isolation from the remote nodes.”…””}”(hjâhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h Khj°hžhubeh}”(h]”Œcpusets-mems-allowed-quirk”ah ]”h"]”Œcpusets.mems_allowed quirk”ah$]”h&]”uh1h´hj7hžhhŸh³h Kubeh}”(h]”Œdemotion”ah ]”h"]”Œdemotion”ah$]”h&]”uh1h´hh¶hžhhŸh³h Kubhµ)”}”(hhh]”(hº)”}”(hŒZSwap and Node Preference”h]”hŒZSwap and Node Preference”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjhžhhŸh³h K%ubhÊ)”}”(hX In Linux v6.15 and below, ZSwap allocates memory from the local node of the processor for the new pages being compressed. Since pages being compressed are typically cold, the result is a cold page becomes promoted - only to be later demoted as it ages off the LRU.”h]”hX In Linux v6.15 and below, ZSwap allocates memory from the local node of the processor for the new pages being compressed. Since pages being compressed are typically cold, the result is a cold page becomes promoted - only to be later demoted as it ages off the LRU.”…””}”(hj$hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K&hjhžhubhÊ)”}”(hŒIn Linux v6.XX, ZSwap tries to prefer the node of the page being compressed as the allocation target for the compression page. This helps prevent thrashing.”h]”hŒIn Linux v6.XX, ZSwap tries to prefer the node of the page being compressed as the allocation target for the compression page. This helps prevent thrashing.”…””}”(hj2hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K+hjhžhubeh}”(h]”Œzswap-and-node-preference”ah ]”h"]”Œzswap and node preference”ah$]”h&]”uh1h´hh¶hžhhŸh³h K%ubhµ)”}”(hhh]”(hº)”}”(hŒDemotion with ZSwap”h]”hŒDemotion with ZSwap”…””}”(hjKhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjHhžhhŸh³h K0ubhÊ)”}”(hŒ§When enabling both Demotion and ZSwap, you create a situation where ZSwap will prefer the slowest form of CXL memory by default until that tier of memory is exhausted.”h]”hŒ§When enabling both Demotion and ZSwap, you create a situation where ZSwap will prefer the slowest form of CXL memory by default until that tier of memory is exhausted.”…””}”(hjYhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÉhŸh³h K1hjHhžhubeh}”(h]”Œdemotion-with-zswap”ah ]”h"]”Œdemotion with zswap”ah$]”h&]”uh1h´hh¶hžhhŸh³h K0ubeh}”(h]”Œreclaim”ah ]”h"]”Œreclaim”ah$]”h&]”uh1h´hhhžhhŸh³h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h³uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¹NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jšŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h³Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jtjqjj jjjEjBjljiuŒ nametypes”}”(jt‰j‰j‰jE‰jl‰uh}”(jqh¶j j7jj°jBjjijHuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.