€•D©Œ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”Œ'/translations/zh_CN/staging/static-keys”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/zh_TW/staging/static-keys”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/it_IT/staging/static-keys”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ja_JP/staging/static-keys”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/ko_KR/staging/static-keys”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/pt_BR/staging/static-keys”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ'/translations/sp_SP/staging/static-keys”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒ Static Keys”h]”hŒ Static Keys”…”�”}”(hh¼h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhh·h²hh³ŒA/var/lib/git/docbuild/linux/Documentation/staging/static-keys.rst”h´KubhŒwarning”“”)�”}”(hXCDEPRECATED API: The use of 'struct static_key' directly, is now DEPRECATED. In addition static_key_{true,false}() is also DEPRECATED. IE DO NOT use the following:: struct static_key false = STATIC_KEY_INIT_FALSE; struct static_key true = STATIC_KEY_INIT_TRUE; static_key_true() static_key_false() The updated API replacements are:: DEFINE_STATIC_KEY_TRUE(key); DEFINE_STATIC_KEY_FALSE(key); DEFINE_STATIC_KEY_ARRAY_TRUE(keys, count); DEFINE_STATIC_KEY_ARRAY_FALSE(keys, count); static_branch_likely() static_branch_unlikely()”h]”(hŒ paragraph”“”)�”}”(hŒDEPRECATED API:”h]”hŒDEPRECATED API:”…”�”}”(hhÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KhhÍubhÒ)�”}”(hŒ“The use of 'struct static_key' directly, is now DEPRECATED. In addition static_key_{true,false}() is also DEPRECATED. IE DO NOT use the following::”h]”hŒ–The use of ‘struct static_key’ directly, is now DEPRECATED. In addition static_key_{true,false}() is also DEPRECATED. IE DO NOT use the following:”…”�”}”(hháh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K hhÍubhŒ literal_block”“”)�”}”(hŒ„struct static_key false = STATIC_KEY_INIT_FALSE; struct static_key true = STATIC_KEY_INIT_TRUE; static_key_true() static_key_false()”h]”hŒ„struct static_key false = STATIC_KEY_INIT_FALSE; struct static_key true = STATIC_KEY_INIT_TRUE; static_key_true() static_key_false()”…”�”}”hhñsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hïh³hÊh´K hhÍubhÒ)�”}”(hŒ"The updated API replacements are::”h]”hŒ!The updated API replacements are:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KhhÍubhð)�”}”(hŒÁDEFINE_STATIC_KEY_TRUE(key); DEFINE_STATIC_KEY_FALSE(key); DEFINE_STATIC_KEY_ARRAY_TRUE(keys, count); DEFINE_STATIC_KEY_ARRAY_FALSE(keys, count); static_branch_likely() static_branch_unlikely()”h]”hŒÁDEFINE_STATIC_KEY_TRUE(key); DEFINE_STATIC_KEY_FALSE(key); DEFINE_STATIC_KEY_ARRAY_TRUE(keys, count); DEFINE_STATIC_KEY_ARRAY_FALSE(keys, count); static_branch_likely() static_branch_unlikely()”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´KhhÍubeh}”(h]”h ]”h"]”h$]”h&]”uh1hËhh·h²hh³hÊh´Nubh¶)�”}”(hhh]”(h»)�”}”(hŒAbstract”h]”hŒAbstract”…”�”}”(hj&h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj#h²hh³hÊh´KubhÒ)�”}”(hŒ«Static keys allows the inclusion of seldom used features in performance-sensitive fast-path kernel code, via a GCC feature and a code patching technique. A quick example::”h]”hŒªStatic keys allows the inclusion of seldom used features in performance-sensitive fast-path kernel code, via a GCC feature and a code patching technique. A quick example:”…”�”}”(hj4h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Khj#h²hubhð)�”}”(hŒÀDEFINE_STATIC_KEY_FALSE(key); ... if (static_branch_unlikely(&key)) do unlikely code else do likely code ... static_branch_enable(&key); ... static_branch_disable(&key); ...”h]”hŒÀDEFINE_STATIC_KEY_FALSE(key); ... if (static_branch_unlikely(&key)) do unlikely code else do likely code ... static_branch_enable(&key); ... static_branch_disable(&key); ...”…”�”}”hjBsbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´K!hj#h²hubhÒ)�”}”(hŒ~The static_branch_unlikely() branch will be generated into the code with as little impact to the likely code path as possible.”h]”hŒ~The static_branch_unlikely() branch will be generated into the code with as little impact to the likely code path as possible.”…”�”}”(hjPh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K0hj#h²hubeh}”(h]”Œabstract”ah ]”h"]”Œabstract”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kubh¶)�”}”(hhh]”(h»)�”}”(hŒ Motivation”h]”hŒ Motivation”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjfh²hh³hÊh´K5ubhÒ)�”}”(hXîCurrently, tracepoints are implemented using a conditional branch. The conditional check requires checking a global variable for each tracepoint. Although the overhead of this check is small, it increases when the memory cache comes under pressure (memory cache lines for these global variables may be shared with other memory accesses). As we increase the number of tracepoints in the kernel this overhead may become more of an issue. In addition, tracepoints are often dormant (disabled) and provide no direct kernel functionality. Thus, it is highly desirable to reduce their impact as much as possible. Although tracepoints are the original motivation for this work, other kernel code paths should be able to make use of the static keys facility.”h]”hXîCurrently, tracepoints are implemented using a conditional branch. The conditional check requires checking a global variable for each tracepoint. Although the overhead of this check is small, it increases when the memory cache comes under pressure (memory cache lines for these global variables may be shared with other memory accesses). As we increase the number of tracepoints in the kernel this overhead may become more of an issue. In addition, tracepoints are often dormant (disabled) and provide no direct kernel functionality. Thus, it is highly desirable to reduce their impact as much as possible. Although tracepoints are the original motivation for this work, other kernel code paths should be able to make use of the static keys facility.”…”�”}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K8hjfh²hubeh}”(h]”Œ motivation”ah ]”h"]”Œ motivation”ah$]”h&]”uh1hµhh·h²hh³hÊh´K5ubh¶)�”}”(hhh]”(h»)�”}”(hŒSolution”h]”hŒSolution”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhj�h²hh³hÊh´KEubhÒ)�”}”(hŒLgcc (v4.5) adds a new 'asm goto' statement that allows branching to a label:”h]”hŒPgcc (v4.5) adds a new ‘asm goto’ statement that allows branching to a label:”…”�”}”(hjžh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KHhj�h²hubhÒ)�”}”(hŒ8https://gcc.gnu.org/ml/gcc-patches/2009-07/msg01556.html”h]”hŒ reference”“”)�”}”(hj®h]”hŒ8https://gcc.gnu.org/ml/gcc-patches/2009-07/msg01556.html”…”�”}”(hj²h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”j®uh1j°hj¬ubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KJhj�h²hubhÒ)�”}”(hŒÍUsing the 'asm goto', we can create branches that are either taken or not taken by default, without the need to check memory. Then, at run-time, we can patch the branch site to change the branch direction.”h]”hŒÑUsing the ‘asm goto’, we can create branches that are either taken or not taken by default, without the need to check memory. Then, at run-time, we can patch the branch site to change the branch direction.”…”�”}”(hjÆh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KLhj�h²hubhÒ)�”}”(hŒEFor example, if we have a simple branch that is disabled by default::”h]”hŒDFor example, if we have a simple branch that is disabled by default:”…”�”}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KPhj�h²hubhð)�”}”(hŒKif (static_branch_unlikely(&key)) printk("I am the true branch\n");”h]”hŒKif (static_branch_unlikely(&key)) printk("I am the true branch\n");”…”�”}”hjâsbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´KRhj�h²hubhÒ)�”}”(hXÇThus, by default the 'printk' will not be emitted. And the code generated will consist of a single atomic 'no-op' instruction (5 bytes on x86), in the straight-line code path. When the branch is 'flipped', we will patch the 'no-op' in the straight-line codepath with a 'jump' instruction to the out-of-line true branch. Thus, changing branch direction is expensive but branch selection is basically 'free'. That is the basic tradeoff of this optimization.”h]”hXßThus, by default the ‘printk’ will not be emitted. And the code generated will consist of a single atomic ‘no-op’ instruction (5 bytes on x86), in the straight-line code path. When the branch is ‘flipped’, we will patch the ‘no-op’ in the straight-line codepath with a ‘jump’ instruction to the out-of-line true branch. Thus, changing branch direction is expensive but branch selection is basically ‘free’. That is the basic tradeoff of this optimization.”…”�”}”(hjðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KUhj�h²hubhÒ)�”}”(hŒwThis low-level patching mechanism is called 'jump label patching', and it gives the basis for the static keys facility.”h]”hŒ{This low-level patching mechanism is called ‘jump label patching’, and it gives the basis for the static keys facility.”…”�”}”(hjþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K]hj�h²hubeh}”(h]”Œsolution”ah ]”h"]”Œsolution”ah$]”h&]”uh1hµhh·h²hh³hÊh´KEubh¶)�”}”(hhh]”(h»)�”}”(hŒ(Static key label API, usage and examples”h]”hŒ(Static key label API, usage and examples”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hºhjh²hh³hÊh´KaubhÒ)�”}”(hŒGIn order to make use of this optimization you must first define a key::”h]”hŒFIn order to make use of this optimization you must first define a key:”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Kdhjh²hubhð)�”}”(hŒDEFINE_STATIC_KEY_TRUE(key);”h]”hŒDEFINE_STATIC_KEY_TRUE(key);”…”�”}”hj3sbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´Kfhjh²hubhÒ)�”}”(hŒor::”h]”hŒor:”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Khhjh²hubhð)�”}”(hŒDEFINE_STATIC_KEY_FALSE(key);”h]”hŒDEFINE_STATIC_KEY_FALSE(key);”…”�”}”hjOsbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´Kjhjh²hubhÒ)�”}”(hŒiThe key must be global, that is, it can't be allocated on the stack or dynamically allocated at run-time.”h]”hŒkThe key must be global, that is, it can’t be allocated on the stack or dynamically allocated at run-time.”…”�”}”(hj]h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Kmhjh²hubhÒ)�”}”(hŒ!The key is then used in code as::”h]”hŒ The key is then used in code as:”…”�”}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Kphjh²hubhð)�”}”(hŒVif (static_branch_unlikely(&key)) do unlikely code else do likely code”h]”hŒVif (static_branch_unlikely(&key)) do unlikely code else do likely code”…”�”}”hjysbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´Krhjh²hubhÒ)�”}”(hŒOr::”h]”hŒOr:”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Kwhjh²hubhð)�”}”(hŒTif (static_branch_likely(&key)) do likely code else do unlikely code”h]”hŒTif (static_branch_likely(&key)) do likely code else do unlikely code”…”�”}”hj•sbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´Kyhjh²hubhÒ)�”}”(hŒ›Keys defined via DEFINE_STATIC_KEY_TRUE(), or DEFINE_STATIC_KEY_FALSE, may be used in either static_branch_likely() or static_branch_unlikely() statements.”h]”hŒ›Keys defined via DEFINE_STATIC_KEY_TRUE(), or DEFINE_STATIC_KEY_FALSE, may be used in either static_branch_likely() or static_branch_unlikely() statements.”…”�”}”(hj£h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K~hjh²hubhÒ)�”}”(hŒ Branch(es) can be set true via::”h]”hŒBranch(es) can be set true via:”…”�”}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K‚hjh²hubhð)�”}”(hŒstatic_branch_enable(&key);”h]”hŒstatic_branch_enable(&key);”…”�”}”hj¿sbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´K„hjh²hubhÒ)�”}”(hŒor false via::”h]”hŒ or false via:”…”�”}”(hjÍh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K†hjh²hubhð)�”}”(hŒstatic_branch_disable(&key);”h]”hŒstatic_branch_disable(&key);”…”�”}”hjÛsbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´Kˆhjh²hubhÒ)�”}”(hŒ:The branch(es) can then be switched via reference counts::”h]”hŒ9The branch(es) can then be switched via reference counts:”…”�”}”(hjéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KŠhjh²hubhð)�”}”(hŒ5static_branch_inc(&key); ... static_branch_dec(&key);”h]”hŒ5static_branch_inc(&key); ... static_branch_dec(&key);”…”�”}”hj÷sbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´KŒhjh²hubhÒ)�”}”(hXîThus, 'static_branch_inc()' means 'make the branch true', and 'static_branch_dec()' means 'make the branch false' with appropriate reference counting. For example, if the key is initialized true, a static_branch_dec(), will switch the branch to false. And a subsequent static_branch_inc(), will change the branch back to true. Likewise, if the key is initialized false, a 'static_branch_inc()', will change the branch to true. And then a 'static_branch_dec()', will again make the branch false.”h]”hXThus, ‘static_branch_inc()’ means ‘make the branch true’, and ‘static_branch_dec()’ means ‘make the branch false’ with appropriate reference counting. For example, if the key is initialized true, a static_branch_dec(), will switch the branch to false. And a subsequent static_branch_inc(), will change the branch back to true. Likewise, if the key is initialized false, a ‘static_branch_inc()’, will change the branch to true. And then a ‘static_branch_dec()’, will again make the branch false.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K�hjh²hubhÒ)�”}”(hŒþThe state and the reference count can be retrieved with 'static_key_enabled()' and 'static_key_count()'. In general, if you use these functions, they should be protected with the same mutex used around the enable/disable or increment/decrement function.”h]”hXThe state and the reference count can be retrieved with ‘static_key_enabled()’ and ‘static_key_count()’. In general, if you use these functions, they should be protected with the same mutex used around the enable/disable or increment/decrement function.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K˜hjh²hubhÒ)�”}”(hX{Note that switching branches results in some locks being taken, particularly the CPU hotplug lock (in order to avoid races against CPUs being brought in the kernel while the kernel is getting patched). Calling the static key API from within a hotplug notifier is thus a sure deadlock recipe. In order to still allow use of the functionality, the following functions are provided:”h]”hX{Note that switching branches results in some locks being taken, particularly the CPU hotplug lock (in order to avoid races against CPUs being brought in the kernel while the kernel is getting patched). Calling the static key API from within a hotplug notifier is thus a sure deadlock recipe. In order to still allow use of the functionality, the following functions are provided:”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K�hjh²hubhŒ block_quote”“”)�”}”(hŒ„static_key_enable_cpuslocked() static_key_disable_cpuslocked() static_branch_enable_cpuslocked() static_branch_disable_cpuslocked() ”h]”hÒ)�”}”(hŒƒstatic_key_enable_cpuslocked() static_key_disable_cpuslocked() static_branch_enable_cpuslocked() static_branch_disable_cpuslocked()”h]”hŒƒstatic_key_enable_cpuslocked() static_key_disable_cpuslocked() static_branch_enable_cpuslocked() static_branch_disable_cpuslocked()”…”�”}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K¤hj1ubah}”(h]”h ]”h"]”h$]”h&]”uh1j/h³hÊh´K¤hjh²hubhÒ)�”}”(hŒ…These functions are *not* general purpose, and must only be used when you really know that you're in the above context, and no other.”h]”(hŒThese functions are ”…”�”}”(hjIh²hh³Nh´NubhŒemphasis”“”)�”}”(hŒ*not*”h]”hŒnot”…”�”}”(hjSh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jQhjIubhŒn general purpose, and must only be used when you really know that you’re in the above context, and no other.”…”�”}”(hjIh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K©hjh²hubhÒ)�”}”(hŒ:Where an array of keys is required, it can be defined as::”h]”hŒ9Where an array of keys is required, it can be defined as:”…”�”}”(hjkh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K¬hjh²hubhð)�”}”(hŒ*DEFINE_STATIC_KEY_ARRAY_TRUE(keys, count);”h]”hŒ*DEFINE_STATIC_KEY_ARRAY_TRUE(keys, count);”…”�”}”hjysbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´K®hjh²hubhÒ)�”}”(hŒor::”h]”hŒor:”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K°hjh²hubhð)�”}”(hŒ+DEFINE_STATIC_KEY_ARRAY_FALSE(keys, count);”h]”hŒ+DEFINE_STATIC_KEY_ARRAY_FALSE(keys, count);”…”�”}”hj•sbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´K²hjh²hubhŒenumerated_list”“”)�”}”(hhh]”hŒ list_item”“”)�”}”(hŒ;Architecture level code patching interface, 'jump labels' ”h]”hÒ)�”}”(hŒ9Architecture level code patching interface, 'jump labels'”h]”hŒ=Architecture level code patching interface, ‘jump labels’”…”�”}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K´hjªubah}”(h]”h ]”h"]”h$]”h&]”uh1j¨hj¥h²hh³hÊh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ)”Œstart”Kuh1j£hjh²hh³hÊh´K´ubhÒ)�”}”(hXtThere are a few functions and macros that architectures must implement in order to take advantage of this optimization. If there is no architecture support, we simply fall back to a traditional, load, test, and jump sequence. Also, the struct jump_entry table must be at least 4-byte aligned because the static_key->entry field makes use of the two least significant bits.”h]”hXtThere are a few functions and macros that architectures must implement in order to take advantage of this optimization. If there is no architecture support, we simply fall back to a traditional, load, test, and jump sequence. Also, the struct jump_entry table must be at least 4-byte aligned because the static_key->entry field makes use of the two least significant bits.”…”�”}”(hjÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K·hjh²hubhŒ bullet_list”“”)�”}”(hhh]”(j©)�”}”(hŒ9``select HAVE_ARCH_JUMP_LABEL``, see: arch/x86/Kconfig ”h]”hŒdefinition_list”“”)�”}”(hhh]”hŒdefinition_list_item”“”)�”}”(hŒ7``select HAVE_ARCH_JUMP_LABEL``, see: arch/x86/Kconfig ”h]”(hŒterm”“”)�”}”(hŒ ``select HAVE_ARCH_JUMP_LABEL``,”h]”(hŒliteral”“”)�”}”(hŒ``select HAVE_ARCH_JUMP_LABEL``”h]”hŒselect HAVE_ARCH_JUMP_LABEL”…”�”}”(hjøh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jöhjòubhŒ,”…”�”}”(hjòh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jðh³hÊh´K¾hjìubhŒ definition”“”)�”}”(hhh]”hÒ)�”}”(hŒsee: arch/x86/Kconfig”h]”hŒsee: arch/x86/Kconfig”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´K¾hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjìubeh}”(h]”h ]”h"]”h$]”h&]”uh1jêh³hÊh´K¾hjçubah}”(h]”h ]”h"]”h$]”h&]”uh1jåhjáubah}”(h]”h ]”h"]”h$]”h&]”uh1j¨hjÞh²hh³Nh´Nubj©)�”}”(hŒJ``#define JUMP_LABEL_NOP_SIZE``, see: arch/x86/include/asm/jump_label.h ”h]”jæ)�”}”(hhh]”jë)�”}”(hŒH``#define JUMP_LABEL_NOP_SIZE``, see: arch/x86/include/asm/jump_label.h ”h]”(jñ)�”}”(hŒ ``#define JUMP_LABEL_NOP_SIZE``,”h]”(j÷)�”}”(hŒ``#define JUMP_LABEL_NOP_SIZE``”h]”hŒ#define JUMP_LABEL_NOP_SIZE”…”�”}”(hjJh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jöhjFubhŒ,”…”�”}”(hjFh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jðh³hÊh´KÁhjBubj)�”}”(hhh]”hÒ)�”}”(hŒ&see: arch/x86/include/asm/jump_label.h”h]”hŒ&see: arch/x86/include/asm/jump_label.h”…”�”}”(hjeh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KÁhjbubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjBubeh}”(h]”h ]”h"]”h$]”h&]”uh1jêh³hÊh´KÁhj?ubah}”(h]”h ]”h"]”h$]”h&]”uh1jåhj;ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¨hjÞh²hh³Nh´Nubj©)�”}”(hŒ{``__always_inline bool arch_static_branch(struct static_key *key, bool branch)``, see: arch/x86/include/asm/jump_label.h ”h]”jæ)�”}”(hhh]”jë)�”}”(hŒy``__always_inline bool arch_static_branch(struct static_key *key, bool branch)``, see: arch/x86/include/asm/jump_label.h ”h]”(jñ)�”}”(hŒQ``__always_inline bool arch_static_branch(struct static_key *key, bool branch)``,”h]”(j÷)�”}”(hŒP``__always_inline bool arch_static_branch(struct static_key *key, bool branch)``”h]”hŒL__always_inline bool arch_static_branch(struct static_key *key, bool branch)”…”�”}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jöhj–ubhŒ,”…”�”}”(hj–h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jðh³hÊh´KÄhj’ubj)�”}”(hhh]”hÒ)�”}”(hŒ&see: arch/x86/include/asm/jump_label.h”h]”hŒ&see: arch/x86/include/asm/jump_label.h”…”�”}”(hjµh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KÄhj²ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj’ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jêh³hÊh´KÄhj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1jåhj‹ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¨hjÞh²hh³Nh´Nubj©)�”}”(hŒ€``__always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)``, see: arch/x86/include/asm/jump_label.h ”h]”jæ)�”}”(hhh]”jë)�”}”(hŒ~``__always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)``, see: arch/x86/include/asm/jump_label.h ”h]”(jñ)�”}”(hŒV``__always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)``,”h]”(j÷)�”}”(hŒU``__always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)``”h]”hŒQ__always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)”…”�”}”(hjêh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jöhjæubhŒ,”…”�”}”(hjæh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jðh³hÊh´KÇhjâubj)�”}”(hhh]”hÒ)�”}”(hŒ&see: arch/x86/include/asm/jump_label.h”h]”hŒ&see: arch/x86/include/asm/jump_label.h”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KÇhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjâubeh}”(h]”h ]”h"]”h$]”h&]”uh1jêh³hÊh´KÇhjßubah}”(h]”h ]”h"]”h$]”h&]”uh1jåhjÛubah}”(h]”h ]”h"]”h$]”h&]”uh1j¨hjÞh²hh³Nh´Nubj©)�”}”(hŒ}``void arch_jump_label_transform(struct jump_entry *entry, enum jump_label_type type)``, see: arch/x86/kernel/jump_label.c ”h]”jæ)�”}”(hhh]”jë)�”}”(hŒ{``void arch_jump_label_transform(struct jump_entry *entry, enum jump_label_type type)``, see: arch/x86/kernel/jump_label.c ”h]”(jñ)�”}”(hŒX``void arch_jump_label_transform(struct jump_entry *entry, enum jump_label_type type)``,”h]”(j÷)�”}”(hŒW``void arch_jump_label_transform(struct jump_entry *entry, enum jump_label_type type)``”h]”hŒSvoid arch_jump_label_transform(struct jump_entry *entry, enum jump_label_type type)”…”�”}”(hj:h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jöhj6ubhŒ,”…”�”}”(hj6h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jðh³hÊh´KÊhj2ubj)�”}”(hhh]”hÒ)�”}”(hŒ!see: arch/x86/kernel/jump_label.c”h]”hŒ!see: arch/x86/kernel/jump_label.c”…”�”}”(hjUh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KÊhjRubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj2ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jêh³hÊh´KÊhj/ubah}”(h]”h ]”h"]”h$]”h&]”uh1jåhj+ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¨hjÞh²hh³Nh´Nubj©)�”}”(hŒA``struct jump_entry``, see: arch/x86/include/asm/jump_label.h ”h]”jæ)�”}”(hhh]”jë)�”}”(hŒ?``struct jump_entry``, see: arch/x86/include/asm/jump_label.h ”h]”(jñ)�”}”(hŒ``struct jump_entry``,”h]”(j÷)�”}”(hŒ``struct jump_entry``”h]”hŒstruct jump_entry”…”�”}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jöhj†ubhŒ,”…”�”}”(hj†h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1jðh³hÊh´KÎhj‚ubj)�”}”(hhh]”hÒ)�”}”(hŒ&see: arch/x86/include/asm/jump_label.h”h]”hŒ&see: arch/x86/include/asm/jump_label.h”…”�”}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KÍhj¢ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj‚ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jêh³hÊh´KÎhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jåhj{ubah}”(h]”h ]”h"]”h$]”h&]”uh1j¨hjÞh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1jÜh³hÊh´K½hjh²hubj¤)�”}”(hhh]”j©)�”}”(hŒ6Static keys / jump label analysis, results (x86_64): ”h]”hÒ)�”}”(hŒ4Static keys / jump label analysis, results (x86_64):”h]”hŒ4Static keys / jump label analysis, results (x86_64):”…”�”}”(hjÚh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KÐhjÖubah}”(h]”h ]”h"]”h$]”h&]”uh1j¨hjÓh²hh³hÊh´Nubah}”(h]”h ]”h"]”h$]”h&]”jÈjÉjÊhjËjÌjÍKuh1j£hjh²hh³hÊh´KÐubhÒ)�”}”(hŒhAs an example, let's add the following branch to 'getppid()', such that the system call now looks like::”h]”hŒmAs an example, let’s add the following branch to ‘getppid()’, such that the system call now looks like:”…”�”}”(hjôh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´KÓhjh²hubhð)�”}”(hX SYSCALL_DEFINE0(getppid) { int pid; + if (static_branch_unlikely(&key)) + printk("I am the true branch\n"); rcu_read_lock(); pid = task_tgid_vnr(rcu_dereference(current->real_parent)); rcu_read_unlock(); return pid; }”h]”hX SYSCALL_DEFINE0(getppid) { int pid; + if (static_branch_unlikely(&key)) + printk("I am the true branch\n"); rcu_read_lock(); pid = task_tgid_vnr(rcu_dereference(current->real_parent)); rcu_read_unlock(); return pid; }”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´KÖhjh²hubhÒ)�”}”(hŒAThe resulting instructions with jump labels generated by GCC is::”h]”hŒ@The resulting instructions with jump labels generated by GCC is:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Kähjh²hubhð)�”}”(hXgffffffff81044290 : ffffffff81044290: 55 push %rbp ffffffff81044291: 48 89 e5 mov %rsp,%rbp ffffffff81044294: e9 00 00 00 00 jmpq ffffffff81044299 ffffffff81044299: 65 48 8b 04 25 c0 b6 mov %gs:0xb6c0,%rax ffffffff810442a0: 00 00 ffffffff810442a2: 48 8b 80 80 02 00 00 mov 0x280(%rax),%rax ffffffff810442a9: 48 8b 80 b0 02 00 00 mov 0x2b0(%rax),%rax ffffffff810442b0: 48 8b b8 e8 02 00 00 mov 0x2e8(%rax),%rdi ffffffff810442b7: e8 f4 d9 00 00 callq ffffffff81051cb0 ffffffff810442bc: 5d pop %rbp ffffffff810442bd: 48 98 cltq ffffffff810442bf: c3 retq ffffffff810442c0: 48 c7 c7 e3 54 98 81 mov $0xffffffff819854e3,%rdi ffffffff810442c7: 31 c0 xor %eax,%eax ffffffff810442c9: e8 71 13 6d 00 callq ffffffff8171563f ffffffff810442ce: eb c9 jmp ffffffff81044299 ”h]”hXgffffffff81044290 : ffffffff81044290: 55 push %rbp ffffffff81044291: 48 89 e5 mov %rsp,%rbp ffffffff81044294: e9 00 00 00 00 jmpq ffffffff81044299 ffffffff81044299: 65 48 8b 04 25 c0 b6 mov %gs:0xb6c0,%rax ffffffff810442a0: 00 00 ffffffff810442a2: 48 8b 80 80 02 00 00 mov 0x280(%rax),%rax ffffffff810442a9: 48 8b 80 b0 02 00 00 mov 0x2b0(%rax),%rax ffffffff810442b0: 48 8b b8 e8 02 00 00 mov 0x2e8(%rax),%rdi ffffffff810442b7: e8 f4 d9 00 00 callq ffffffff81051cb0 ffffffff810442bc: 5d pop %rbp ffffffff810442bd: 48 98 cltq ffffffff810442bf: c3 retq ffffffff810442c0: 48 c7 c7 e3 54 98 81 mov $0xffffffff819854e3,%rdi ffffffff810442c7: 31 c0 xor %eax,%eax ffffffff810442c9: e8 71 13 6d 00 callq ffffffff8171563f ffffffff810442ce: eb c9 jmp ffffffff81044299 ”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´Kæhjh²hubhÒ)�”}”(hŒ3Without the jump label optimization it looks like::”h]”hŒ2Without the jump label optimization it looks like:”…”�”}”(hj,h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Køhjh²hubhð)�”}”(hX‰ffffffff810441f0 : ffffffff810441f0: 8b 05 8a 52 d8 00 mov 0xd8528a(%rip),%eax # ffffffff81dc9480 ffffffff810441f6: 55 push %rbp ffffffff810441f7: 48 89 e5 mov %rsp,%rbp ffffffff810441fa: 85 c0 test %eax,%eax ffffffff810441fc: 75 27 jne ffffffff81044225 ffffffff810441fe: 65 48 8b 04 25 c0 b6 mov %gs:0xb6c0,%rax ffffffff81044205: 00 00 ffffffff81044207: 48 8b 80 80 02 00 00 mov 0x280(%rax),%rax ffffffff8104420e: 48 8b 80 b0 02 00 00 mov 0x2b0(%rax),%rax ffffffff81044215: 48 8b b8 e8 02 00 00 mov 0x2e8(%rax),%rdi ffffffff8104421c: e8 2f da 00 00 callq ffffffff81051c50 ffffffff81044221: 5d pop %rbp ffffffff81044222: 48 98 cltq ffffffff81044224: c3 retq ffffffff81044225: 48 c7 c7 13 53 98 81 mov $0xffffffff81985313,%rdi ffffffff8104422c: 31 c0 xor %eax,%eax ffffffff8104422e: e8 60 0f 6d 00 callq ffffffff81715193 ffffffff81044233: eb c9 jmp ffffffff810441fe ffffffff81044235: 66 66 2e 0f 1f 84 00 data32 nopw %cs:0x0(%rax,%rax,1) ffffffff8104423c: 00 00 00 00”h]”hX‰ffffffff810441f0 : ffffffff810441f0: 8b 05 8a 52 d8 00 mov 0xd8528a(%rip),%eax # ffffffff81dc9480 ffffffff810441f6: 55 push %rbp ffffffff810441f7: 48 89 e5 mov %rsp,%rbp ffffffff810441fa: 85 c0 test %eax,%eax ffffffff810441fc: 75 27 jne ffffffff81044225 ffffffff810441fe: 65 48 8b 04 25 c0 b6 mov %gs:0xb6c0,%rax ffffffff81044205: 00 00 ffffffff81044207: 48 8b 80 80 02 00 00 mov 0x280(%rax),%rax ffffffff8104420e: 48 8b 80 b0 02 00 00 mov 0x2b0(%rax),%rax ffffffff81044215: 48 8b b8 e8 02 00 00 mov 0x2e8(%rax),%rdi ffffffff8104421c: e8 2f da 00 00 callq ffffffff81051c50 ffffffff81044221: 5d pop %rbp ffffffff81044222: 48 98 cltq ffffffff81044224: c3 retq ffffffff81044225: 48 c7 c7 13 53 98 81 mov $0xffffffff81985313,%rdi ffffffff8104422c: 31 c0 xor %eax,%eax ffffffff8104422e: e8 60 0f 6d 00 callq ffffffff81715193 ffffffff81044233: eb c9 jmp ffffffff810441fe ffffffff81044235: 66 66 2e 0f 1f 84 00 data32 nopw %cs:0x0(%rax,%rax,1) ffffffff8104423c: 00 00 00 00”…”�”}”hj:sbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´Kúhjh²hubhÒ)�”}”(hŒøThus, the disable jump label case adds a 'mov', 'test' and 'jne' instruction vs. the jump label case just has a 'no-op' or 'jmp 0'. (The jmp 0, is patched to a 5 byte atomic no-op instruction at boot-time.) Thus, the disabled jump label case adds::”h]”hX Thus, the disable jump label case adds a ‘mov’, ‘test’ and ‘jne’ instruction vs. the jump label case just has a ‘no-op’ or ‘jmp 0’. (The jmp 0, is patched to a 5 byte atomic no-op instruction at boot-time.) Thus, the disabled jump label case adds:”…”�”}”(hjHh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Mhjh²hubhð)�”}”(hŒI6 (mov) + 2 (test) + 2 (jne) = 10 - 5 (5 byte jump 0) = 5 addition bytes.”h]”hŒI6 (mov) + 2 (test) + 2 (jne) = 10 - 5 (5 byte jump 0) = 5 addition bytes.”…”�”}”hjVsbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´Mhjh²hubhÒ)�”}”(hXØIf we then include the padding bytes, the jump label code saves, 16 total bytes of instruction memory for this small function. In this case the non-jump label function is 80 bytes long. Thus, we have saved 20% of the instruction footprint. We can in fact improve this even further, since the 5-byte no-op really can be a 2-byte no-op since we can reach the branch with a 2-byte jmp. However, we have not yet implemented optimal no-op sizes (they are currently hard-coded).”h]”hXØIf we then include the padding bytes, the jump label code saves, 16 total bytes of instruction memory for this small function. In this case the non-jump label function is 80 bytes long. Thus, we have saved 20% of the instruction footprint. We can in fact improve this even further, since the 5-byte no-op really can be a 2-byte no-op since we can reach the branch with a 2-byte jmp. However, we have not yet implemented optimal no-op sizes (they are currently hard-coded).”…”�”}”(hjdh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Mhjh²hubhÒ)�”}”(hŒÇSince there are a number of static key API uses in the scheduler paths, 'pipe-test' (also known as 'perf bench sched pipe') can be used to show the performance improvement. Testing done on 3.3.0-rc2:”h]”hŒÏSince there are a number of static key API uses in the scheduler paths, ‘pipe-test’ (also known as ‘perf bench sched pipe’) can be used to show the performance improvement. Testing done on 3.3.0-rc2:”…”�”}”(hjrh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´Mhjh²hubhÒ)�”}”(hŒjump label disabled::”h]”hŒjump label disabled:”…”�”}”(hj€h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´M#hjh²hubhð)�”}”(hXäPerformance counter stats for 'bash -c /tmp/pipe-test' (50 runs): 855.700314 task-clock # 0.534 CPUs utilized ( +- 0.11% ) 200,003 context-switches # 0.234 M/sec ( +- 0.00% ) 0 CPU-migrations # 0.000 M/sec ( +- 39.58% ) 487 page-faults # 0.001 M/sec ( +- 0.02% ) 1,474,374,262 cycles # 1.723 GHz ( +- 0.17% ) stalled-cycles-frontend stalled-cycles-backend 1,178,049,567 instructions # 0.80 insns per cycle ( +- 0.06% ) 208,368,926 branches # 243.507 M/sec ( +- 0.06% ) 5,569,188 branch-misses # 2.67% of all branches ( +- 0.54% ) 1.601607384 seconds time elapsed ( +- 0.07% )”h]”hXäPerformance counter stats for 'bash -c /tmp/pipe-test' (50 runs): 855.700314 task-clock # 0.534 CPUs utilized ( +- 0.11% ) 200,003 context-switches # 0.234 M/sec ( +- 0.00% ) 0 CPU-migrations # 0.000 M/sec ( +- 39.58% ) 487 page-faults # 0.001 M/sec ( +- 0.02% ) 1,474,374,262 cycles # 1.723 GHz ( +- 0.17% ) stalled-cycles-frontend stalled-cycles-backend 1,178,049,567 instructions # 0.80 insns per cycle ( +- 0.06% ) 208,368,926 branches # 243.507 M/sec ( +- 0.06% ) 5,569,188 branch-misses # 2.67% of all branches ( +- 0.54% ) 1.601607384 seconds time elapsed ( +- 0.07% )”…”�”}”hjŽsbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´M%hjh²hubhÒ)�”}”(hŒjump label enabled::”h]”hŒjump label enabled:”…”�”}”(hjœh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´M4hjh²hubhð)�”}”(hX­Performance counter stats for 'bash -c /tmp/pipe-test' (50 runs): 841.043185 task-clock # 0.533 CPUs utilized ( +- 0.12% ) 200,004 context-switches # 0.238 M/sec ( +- 0.00% ) 0 CPU-migrations # 0.000 M/sec ( +- 40.87% ) 487 page-faults # 0.001 M/sec ( +- 0.05% ) 1,432,559,428 cycles # 1.703 GHz ( +- 0.18% ) stalled-cycles-frontend stalled-cycles-backend 1,175,363,994 instructions # 0.82 insns per cycle ( +- 0.04% ) 206,859,359 branches # 245.956 M/sec ( +- 0.04% ) 4,884,119 branch-misses # 2.36% of all branches ( +- 0.85% ) 1.579384366 seconds time elapsed”h]”hX­Performance counter stats for 'bash -c /tmp/pipe-test' (50 runs): 841.043185 task-clock # 0.533 CPUs utilized ( +- 0.12% ) 200,004 context-switches # 0.238 M/sec ( +- 0.00% ) 0 CPU-migrations # 0.000 M/sec ( +- 40.87% ) 487 page-faults # 0.001 M/sec ( +- 0.05% ) 1,432,559,428 cycles # 1.703 GHz ( +- 0.18% ) stalled-cycles-frontend stalled-cycles-backend 1,175,363,994 instructions # 0.82 insns per cycle ( +- 0.04% ) 206,859,359 branches # 245.956 M/sec ( +- 0.04% ) 4,884,119 branch-misses # 2.36% of all branches ( +- 0.85% ) 1.579384366 seconds time elapsed”…”�”}”hjªsbah}”(h]”h ]”h"]”h$]”h&]”hÿjuh1hïh³hÊh´M6hjh²hubhÒ)�”}”(hX$The percentage of saved branches is .7%, and we've saved 12% on 'branch-misses'. This is where we would expect to get the most savings, since this optimization is about reducing the number of branches. In addition, we've saved .2% on instructions, and 2.8% on cycles and 1.4% on elapsed time.”h]”hX,The percentage of saved branches is .7%, and we’ve saved 12% on ‘branch-misses’. This is where we would expect to get the most savings, since this optimization is about reducing the number of branches. In addition, we’ve saved .2% on instructions, and 2.8% on cycles and 1.4% on elapsed time.”…”�”}”(hj¸h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑh³hÊh´MEhjh²hubeh}”(h]”Œ'static-key-label-api-usage-and-examples”ah ]”h"]”Œ(static key label api, usage and examples”ah$]”h&]”uh1hµhh·h²hh³hÊh´Kaubeh}”(h]”Œ static-keys”ah ]”h"]”Œ static keys”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”}”(jÓjÐjcj`jŠj‡jjjËjÈuŒ nametypes”}”(jÓ‰jc‰jЉj‰jˉuh}”(jÐh·j`j#j‡jfjj�jÈjuŒ 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”]”(hŒsystem_message”“”)�”}”(hhh]”hÒ)�”}”(hŒ:Enumerated list start value not ordinal-1: "4" (ordinal 4)”h]”hŒ>Enumerated list start value not ordinal-1: “4â€� (ordinal 4)”…”�”}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑhj]ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”hÊŒline”Kuh1j[hjh²hh³hÊh´K´ubj\)�”}”(hhh]”hÒ)�”}”(hŒ:Enumerated list start value not ordinal-1: "5" (ordinal 5)”h]”hŒ>Enumerated list start value not ordinal-1: “5â€� (ordinal 5)”…”�”}”(hj|h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑhjyubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”jvŒsource”hÊŒline”Kuh1j[hjh²hh³hÊh´KÐubeŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.