€•LDŒ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”Œ' 'random_threshold <#nr_random_ios>' 'read_promote_adjustment ' 'write_promote_adjustment ' 'discard_promote_adjustment '”h]”hŒ¹'sequential_threshold <#nr_sequential_ios>' 'random_threshold <#nr_random_ios>' 'read_promote_adjustment ' 'write_promote_adjustment ' 'discard_promote_adjustment '”…””}”hj?sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1j=hŸh¶h K$hjhžhubeh}”(h]”Œ multiqueue-mq”ah ]”h"]”Œmultiqueue (mq)”ah$]”h&]”uh1h¡hhÿhžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒStochastic multiqueue (smq)”h]”hŒStochastic multiqueue (smq)”…””}”(hjZhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjWhžhhŸh¶h K+ubh¸)”}”(hŒThis policy is the default.”h]”hŒThis policy is the default.”…””}”(hjhhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K-hjWhžhubh¸)”}”(hŒgThe stochastic multi-queue (smq) policy addresses some of the problems with the multiqueue (mq) policy.”h]”hŒgThe stochastic multi-queue (smq) policy addresses some of the problems with the multiqueue (mq) policy.”…””}”(hjvhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K/hjWhžhubh¸)”}”(hŒÍThe smq policy (vs mq) offers the promise of less memory utilization, improved performance and increased adaptability in the face of changing workloads. smq also does not have any cumbersome tuning knobs.”h]”hŒÍThe smq policy (vs mq) offers the promise of less memory utilization, improved performance and increased adaptability in the face of changing workloads. smq also does not have any cumbersome tuning knobs.”…””}”(hj„hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K2hjWhžhubh¸)”}”(hX1Users may switch from "mq" to "smq" simply by appropriately reloading a DM table that is using the cache target. Doing so will cause all of the mq policy's hints to be dropped. Also, performance of the cache may degrade slightly until smq recalculates the origin device's hotspots that should be cached.”h]”hX=Users may switch from “mq†to “smq†simply by appropriately reloading a DM table that is using the cache target. Doing so will cause all of the mq policy’s hints to be dropped. Also, performance of the cache may degrade slightly until smq recalculates the origin device’s hotspots that should be cached.”…””}”(hj’hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K6hjWhžhubh¢)”}”(hhh]”(h§)”}”(hŒ Memory usage”h]”hŒ Memory usage”…””}”(hj£hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj hžhhŸh¶h K=ubh¸)”}”(hŒQThe mq policy used a lot of memory; 88 bytes per cache block on a 64 bit machine.”h]”hŒQThe mq policy used a lot of memory; 88 bytes per cache block on a 64 bit machine.”…””}”(hj±hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K?hj hžhubh¸)”}”(hX#smq uses 28bit indexes to implement its data structures rather than pointers. It avoids storing an explicit hit count for each block. It has a 'hotspot' queue, rather than a pre-cache, which uses a quarter of the entries (each hotspot block covers a larger area than a single cache block).”h]”hX'smq uses 28bit indexes to implement its data structures rather than pointers. It avoids storing an explicit hit count for each block. It has a ‘hotspot’ queue, rather than a pre-cache, which uses a quarter of the entries (each hotspot block covers a larger area than a single cache block).”…””}”(hj¿hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KBhj hžhubh¸)”}”(hŒtAll this means smq uses ~25bytes per cache block. Still a lot of memory, but a substantial improvement nonetheless.”h]”hŒtAll this means smq uses ~25bytes per cache block. Still a lot of memory, but a substantial improvement nonetheless.”…””}”(hjÍhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KHhj hžhubeh}”(h]”Œ memory-usage”ah ]”h"]”Œ memory usage”ah$]”h&]”uh1h¡hjWhžhhŸh¶h K=ubh¢)”}”(hhh]”(h§)”}”(hŒLevel balancing”h]”hŒLevel balancing”…””}”(hjæhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjãhžhhŸh¶h KLubh¸)”}”(hXmq placed entries in different levels of the multiqueue structures based on their hit count (~ln(hit count)). This meant the bottom levels generally had the most entries, and the top ones had very few. Having unbalanced levels like this reduced the efficacy of the multiqueue.”h]”hXmq placed entries in different levels of the multiqueue structures based on their hit count (~ln(hit count)). This meant the bottom levels generally had the most entries, and the top ones had very few. Having unbalanced levels like this reduced the efficacy of the multiqueue.”…””}”(hjôhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KNhjãhžhubh¸)”}”(hX?smq does not maintain a hit count, instead it swaps hit entries with the least recently used entry from the level above. The overall ordering being a side effect of this stochastic process. With this scheme we can decide how many entries occupy each multiqueue level, resulting in better promotion/demotion decisions.”h]”hX?smq does not maintain a hit count, instead it swaps hit entries with the least recently used entry from the level above. The overall ordering being a side effect of this stochastic process. With this scheme we can decide how many entries occupy each multiqueue level, resulting in better promotion/demotion decisions.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KThjãhžhubh¸)”}”(hXAdaptability: The mq policy maintained a hit count for each cache block. For a different block to get promoted to the cache its hit count has to exceed the lowest currently in the cache. This meant it could take a long time for the cache to adapt between varying IO patterns.”h]”hXAdaptability: The mq policy maintained a hit count for each cache block. For a different block to get promoted to the cache its hit count has to exceed the lowest currently in the cache. This meant it could take a long time for the cache to adapt between varying IO patterns.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KZhjãhžhubh¸)”}”(hXMsmq doesn't maintain hit counts, so a lot of this problem just goes away. In addition it tracks performance of the hotspot queue, which is used to decide which blocks to promote. If the hotspot queue is performing badly then it starts moving entries more quickly between levels. This lets it adapt to new IO patterns very quickly.”h]”hXOsmq doesn’t maintain hit counts, so a lot of this problem just goes away. In addition it tracks performance of the hotspot queue, which is used to decide which blocks to promote. If the hotspot queue is performing badly then it starts moving entries more quickly between levels. This lets it adapt to new IO patterns very quickly.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K`hjãhžhubeh}”(h]”Œlevel-balancing”ah ]”h"]”Œlevel balancing”ah$]”h&]”uh1h¡hjWhžhhŸh¶h KLubh¢)”}”(hhh]”(h§)”}”(hŒ Performance”h]”hŒ Performance”…””}”(hj7hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj4hžhhŸh¶h Kgubh¸)”}”(hŒ;Testing smq shows substantially better performance than mq.”h]”hŒ;Testing smq shows substantially better performance than mq.”…””}”(hjEhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kihj4hžhubeh}”(h]”Œ performance”ah ]”h"]”Œ performance”ah$]”h&]”uh1h¡hjWhžhhŸh¶h Kgubeh}”(h]”Œstochastic-multiqueue-smq”ah ]”h"]”Œstochastic multiqueue (smq)”ah$]”h&]”uh1h¡hhÿhžhhŸh¶h K+ubh¢)”}”(hhh]”(h§)”}”(hŒcleaner”h]”hŒcleaner”…””}”(hjfhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjchžhhŸh¶h Klubh¸)”}”(hŒGThe cleaner writes back all dirty blocks in a cache to decommission it.”h]”hŒGThe cleaner writes back all dirty blocks in a cache to decommission it.”…””}”(hjthžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Knhjchžhubeh}”(h]”Œcleaner”ah ]”h"]”Œcleaner”ah$]”h&]”uh1h¡hhÿhžhhŸh¶h Klubeh}”(h]”Œ/overview-of-supplied-cache-replacement-policies”ah ]”h"]”Œ/overview of supplied cache replacement policies”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒExamples”h]”hŒExamples”…””}”(hj•hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj’hžhhŸh¶h Kqubh¸)”}”(hŒThe syntax for a table is::”h]”hŒThe syntax for a table is:”…””}”(hj£hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kshj’hžhubj>)”}”(hŒƒcache <#feature_args> []* <#policy_args> []*”h]”hŒƒcache <#feature_args> []* <#policy_args> []*”…””}”hj±sbah}”(h]”h ]”h"]”h$]”h&]”jMjNuh1j=hŸh¶h Kuhj’hžhubh¸)”}”(hŒ;The syntax to send a message using the dmsetup command is::”h]”hŒ:The syntax to send a message using the dmsetup command is:”…””}”(hj¿hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Kyhj’hžhubj>)”}”(hŒpdmsetup message 0 sequential_threshold 1024 dmsetup message 0 random_threshold 8”h]”hŒpdmsetup message 0 sequential_threshold 1024 dmsetup message 0 random_threshold 8”…””}”hjÍsbah}”(h]”h ]”h"]”h$]”h&]”jMjNuh1j=hŸh¶h K{hj’hžhubh¸)”}”(hŒUsing dmsetup::”h]”hŒUsing dmsetup:”…””}”(hjÛhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K~hj’hžhubj>)”}”(hXdmsetup create blah --table "0 268435456 cache /dev/sdb /dev/sdc \ /dev/sdd 512 0 mq 4 sequential_threshold 1024 random_threshold 8" creates a 128GB large mapped device named 'blah' with the sequential threshold set to 1024 and the random_threshold set to 8.”h]”hXdmsetup create blah --table "0 268435456 cache /dev/sdb /dev/sdc \ /dev/sdd 512 0 mq 4 sequential_threshold 1024 random_threshold 8" creates a 128GB large mapped device named 'blah' with the sequential threshold set to 1024 and the random_threshold set to 8.”…””}”hjésbah}”(h]”h ]”h"]”h$]”h&]”jMjNuh1j=hŸh¶h K€hj’hžhubeh}”(h]”Œexamples”ah ]”h"]”Œexamples”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kqubeh}”(h]”Œguidance-for-writing-policies”ah ]”h"]”Œguidance for writing policies”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”}”(jjjjŒjTjQj`j]jàjÝj1j.jXjUj‡j„jüjùuŒ nametypes”}”(j‰j‰jT‰j`‰jà‰j1‰jX‰j‡‰jü‰uh}”(jh£jŒhÿjQjj]jWjÝj j.jãjUj4j„jcjùj’uŒ 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.