linux/Documentation/static-keys.txt
<<
optiv3./spa > v3./form > v3.a optiv3 href="../linux+v3 o.6/Documenta" /sta" c-keys.txt">optiv3.img src="../.sta" c/gfx/right.png" alt=">>">op./spa >op.spa class="lxr_search">optioptiv3.input typn> hidden" namn> navtarget" ption> ">optiv3.input typn> text" namn> search" id> search">optiv3.butt2/otypn> submit">Search v3./form > ./spa >op.spa class="lxr_prefs" > v3.a href="+prefs?return=Documenta" /sta" c-keys.txt"optiv3 onclick="return ajax_prefs();">optiv3Prefs> v3./a>op./spa >tiv3 3./div >tiv3 3.form ac" ="ajax+*" method="post" onsubmit="return false;">op.input typn> hidden" namn> ajax_lookup" id> ajax_lookup" ption> ">otiv3 3./form >otiv3 3.div class="headingbott2m">
tiv3
tiv3 v3 3.div id> search_results" class="search_results"> v >tiv3 3./div > .div id> content" > .div id> file_contents"
08/bf/63a5fa002769cca94632509f26bc145bdf3e_3/0" 
L1" class="line" namn>
L1">3 31./a>                        Sta"
c Keys

L2" class="line" namn>
L2">3 32./a>                        -----------

L3" class="line" namn>
L3">3 33./a>o
L4" class="line" namn>
L4">3 34./a>By: Jas2/oBar2/o<jbar2/@redhat.com>o
L5" class="line" namn>
L5">3 35./a>o
L6" class="line" namn>
L6">3 36./a>0) Abstrac"o
L7" class="line" namn>
L7">3 37./a>o
L8" class="line" namn>
L8">3 38./a>Sta"
c keys allows the inclus12/oof seldom used features ino
L9" class="line" namn>
L9">3 39./a>performance-sensitive fast-path kernel code, via a GCC feature and a codeo
L10" class="line" namn>
L10">3 v3.8a>patching technique. A quick example:o
L11" class="line" namn>
L11">3 11./a>o
L12" class="line" namn>
L12">3 12./a>        struct sta"
c_key key = STATIC_KEY_INIT_FALSE;o
L13" class="line" namn>
L13">3 13./a>o
L14" class="line" namn>
L14">3 14./a>        ...o
L15" class="line" namn>
L15">3 15./a>o
L16" class="line" namn>
L16">3 16./a>        if (sta"
c_key_false(&key))o
L17" class="line" namn>
L17">3 17./a>                do unlikely codeo
L18" class="line" namn>
L18">3 18./a>        elseo
L19" class="line" namn>
L19">3 19./a>                do likely codeo
L20" class="line" namn>
L20">3 20./a>o
L21" class="line" namn>
L21">3 21./a>        ...o
L22" class="line" namn>
L22">3 22./a>        sta"
c_key_slow_inc();o
L23" class="line" namn>
L23">3 23./a>        ...o
L24" class="line" namn>
L24">3 24./a>        sta"
c_key_slow_inc();o
L25" class="line" namn>
L25">3 25./a>        ...o
L26" class="line" namn>
L26">3 26./a>o
L27" class="line" namn>
L27">3 27./a>The sta"
c_key_false() branch will be generated into the code with as littleo
L28" class="line" namn>
L28">3 28./a>impac" to the likely code path as possible.o
L29" class="line" namn>
L29">3 29./a>o
L30" class="line" namn>
L30">3 30./a>o
L31" class="line" namn>
L31">3 31./a>1) Motiva"
	 o
L32" class="line" namn>
L32">3 32./a>o
L33" class="line" namn>
L33">3 33./a>o
L34" class="line" namn>
L34">3 34./a>Currently, tracepoints are implemented us1ng a condi"
	 al branch. Theo
L35" class="line" namn>
L35">3 35./a>condi"
	 al check requires check1ng a global variable for each tracepoint.o
L36" class="line" namn>
L36">3 36./a>Although the overheadoof this check is small, it increases when the memoryo
L37" class="line" namn>
L37">3 37./a>cache comes under pressure (memory cache lines for these global variables mayo
L38" class="line" namn>
L38">3 38./a>be shared with other memory accesses). As we increase the number of tracepointso
L39" class="line" namn>
L39">3 39./a>in the kernel this overheadomay become more of an issue. In addi"
	 ,o
L40" class="line" namn>
L40">3 40./a>tracepoints are often dormant (disabled) and provide no direc" kernelo
L41" class="line" namn>
L41">3 41./a>func"
	 ality. Thus, it is highly desirable to reduce their impac" as much aso
L42" class="line" namn>
L42">3 42./a>possible. Although tracepoints are the origi al motiva"
	  for this work, othero
L43" class="line" namn>
L43">3 43./a>kernel code paths should be able to make useoof the sta"
c keys facility.o
L44" class="line" namn>
L44">3 44./a>o
L45" class="line" namn>
L45">3 45./a>o
L46" class="line" namn>
L46">3 46./a>2) Solu"
	 o
L47" class="line" namn>
L47">3 47./a>o
L48" class="line" namn>
L48">3 48./a>o
L49" class="line" namn>
L49">3 49./a>gcc (v4.5) adds a new 'asm goto' sta"ement that allows branching to a label:o
L50" class="line" namn>
L50">3 50./a>o
L51" class="line" namn>
L51">3 51./a>http://gcc.gnu.org/ml/gcc-patches/2009-07/msg01556.html./a>o
L52" class="line" namn>
L52">3 52./a>o
L53" class="line" namn>
L53">3 53./a>Us1ng the 'asm goto', we ca  create branches that are either taken or not takeno
L54" class="line" namn>
L54">3 54./a>by default, without the need to check memory. Then, at run-time, we ca  patcho
L55" class="line" namn>
L55">3 55./a>the branch site to change the branch direc"
	 .o
L56" class="line" namn>
L56">3 56./a>o
L57" class="line" namn>
L57">3 57./a>For example, if we have a simple branch that is disabled by default:o
L58" class="line" namn>
L58">3 58./a>o
L59" class="line" namn>
L59">3 59./a>        if (sta"
c_key_false(&key))o
L60" class="line" namn>
L60">3 60./a>                printk("I am the true branch\n");o
L61" class="line" namn>
L61">3 61./a>o
L62" class="line" namn>
L62">3 62./a>Thus, by default the 'printk' will not be emitted. And the code generated willo
L63" class="line" namn>
L63">3 63./a>consist of a s1ngle atom
c 'no-op' instruct
	  (5 bytes 	  x86), in theo
L64" class="line" namn>
L64">3 64./a>straight-line code path. When the branch is 'flipped', we will patch theo
L65" class="line" namn>
L65">3 65./a>'no-op' in the straight-line codepath with a 'jump' instruct
	  to theo
L66" class="line" namn>
L66">3 66./a>out-of-line true branch. Thus, chang1ng branch direc"
	  is expensive bu"o
L67" class="line" namn>
L67">3 67./a>branch select
	  is basically 'free'. That is the basic tradeoffoof thiso
L68" class="line" namn>
L68">3 68./a>12"
miza"
	 .o
L69" class="line" namn>
L69">3 69./a>o
L70" class="line" namn>
L70">3 70./a>This lowlevel patch1ng mechanism is called 'jump label patch1ng', and it giveso
L71" class="line" namn>
L71">3 71./a>the basis for the sta"
c keys facility.o
L72" class="line" namn>
L72">3 72./a>o
L73" class="line" namn>
L73">3 73./a>3) Sta"
c key label API, usage and examples:o
L74" class="line" namn>
L74">3 74./a>o
L75" class="line" namn>
L75">3 75./a>o
L76" class="line" namn>
L76">3 76./a>In order to make useoof this o2"
miza"
	  you must first define a key:o
L77" class="line" namn>
L77">3 77./a>o
L78" class="line" namn>
L78">3 78./a>        struct sta"
c_key key;o
L79" class="line" namn>
L79">3 79./a>o
L80" class="line" namn>
L80">3 80./a>Which is initialized as:o
L81" class="line" namn>
L81">3 81./a>o
L82" class="line" namn>
L82">3 82./a>        struct sta"
c_key key = STATIC_KEY_INIT_TRUE;o
L83" class="line" namn>
L83">3 83./a>o
L84" class="line" namn>
L84">3 84./a>or:o
L85" class="line" namn>
L85">3 85./a>o
L86" class="line" namn>
L86">3 86./a>        struct sta"
c_key key = STATIC_KEY_INIT_FALSE;o
L87" class="line" namn>
L87">3 87./a>o
L88" class="line" namn>
L88">3 88./a>If the key is not initialized, it is default false. The 'struct sta"
c_key',o
L89" class="line" namn>
L89">3 89./a>must be a 'global'. That is, it can't be allocated on the stack or dynamicallyo
L90" class="line" namn>
L90">3 90./a>allocated at run-time.o
L91" class="line" namn>
L91">3 91./a>o
L92" class="line" namn>
L92">3 92./a>The key is then used in code as:o
L93" class="line" namn>
L93">3 93./a>o
L94" class="line" namn>
L94">3 94./a>        if (sta"
c_key_false(&key))o
L95" class="line" namn>
L95">3 95./a>                do unlikely codeo
L96" class="line" namn>
L96">3 96./a>        elseo
L97" class="line" namn>
L97">3 97./a>                do likely codeo
L98" class="line" namn>
L98">3 98./a>o
L99" class="line" namn>
L99">3 99./a>Or:o
L100" class="line" namn>
L100">3100./a>o
L101" class="line" namn>
L101">3101./a>        if (sta"
c_key_true(&key))o
L102" class="line" namn>
L102">3102./a>                do likely codeo
L103" class="line" namn>
L103">3103./a>        elseo
L104" class="line" namn>
L104">3104./a>                do unlikely codeo
L105" class="line" namn>
L105">3105./a>o
L106" class="line" namn>
L106">3106./a>A key that is initialized via 'STATIC_KEY_INIT_FALSE', must be used in ao
L107" class="line" namn>
L107">3107./a>'sta"
c_key_false()' construct. Likewise, a key initialized viao
L108" class="line" namn>
L108">3108./a>'STATIC_KEY_INIT_TRUE' must be used in a 'sta"
c_key_true()' construct. Ao
L109" class="line" namn>
L109">3109./a>s1ngle key ca  be used in many branches, bu" all the branches must match theo
L110" class="line" namn>
L110">31v3.8a>way that the key has been initialized.o
L111" class="line" namn>
L111">3111./a>o
L112" class="line" namn>
L112">3112./a>The branch(es) ca  then be switched via:o
L113" class="line" namn>
L113">3113./a>o
L114" class="line" namn>
L114">3114./a>        sta"
c_key_slow_inc(&key);o
L115" class="line" namn>
L115">3115./a>        ...o
L116" class="line" namn>
L116">3116./a>        sta"
c_key_slow_dec(&key);o
L117" class="line" namn>
L117">3117./a>o
L118" class="line" namn>
L118">3118./a>Thus, 'sta"
c_key_slow_inc()' means 'make the branch true', ando
L119" class="line" namn>
L119">3119./a>'sta"
c_key_slow_dec()' means 'make the the branch false' with appropriateo
L120" class="line" namn>
L120">3120./a>reference count1ng. For example, if the key is initialized true, ao
L121" class="line" namn>
L121">3121./a>sta"
c_key_slow_dec(), will switch the branch to false. And a subsequento
L122" class="line" namn>
L122">3122./a>sta"
c_key_slow_inc(), will change the branch back to true. Likewise, if theo
L123" class="line" namn>
L123">3123./a>key is initialized false, a 'sta"
c_key_slow_inc()', will change the branch too
L124" class="line" namn>
L124">3124./a>true. And then a 'sta"
c_key_slow_dec()', will again make the branch false.o
L125" class="line" namn>
L125">3125./a>o
L126" class="line" namn>
L126">3126./a>An example usage in the kernel is the implementa"
	  of tracepoints:o
L127" class="line" namn>
L127">3127./a>o
L128" class="line" namn>
L128">3128./a>        sta"
c inline void trace_##namn(proto)                          \o
L129" class="line" namn>
L129">3129./a>        {                                                               \o
L130" class="line" namn>
L130">3130./a>                if (sta"
c_key_false(&__tracepoint_##namn.key))         \o
L131" class="line" namn>
L131">3131./a>                        __DO_TRACE(&__tracepoint_##namn,                \o
L132" class="line" namn>
L132">3132./a>                                TP_PROTO(data_proto),                   \o
L133" class="line" namn>
L133">3133./a>                                TP_ARGS(data_args),                     \o
L134" class="line" namn>
L134">3134./a>                                TP_CONDITION(cond));                    \o
L135" class="line" namn>
L135">3135./a>        }o
L136" class="line" namn>
L136">3136./a>o
L137" class="line" namn>
L137">3137./a>Tracepoints are disabled by default, and ca  be placed in performance criticalo
L138" class="line" namn>
L138">3138./a>pieces 	f the kernel. Thus, by us1ng a sta"
c key, the tracepoints ca  haveo
L139" class="line" namn>
L139">3139./a>absolu"ely minimal impac" when not in use.o
L140" class="line" namn>
L140">3140./a>o
L141" class="line" namn>
L141">3141./a>o
L142" class="line" namn>
L142">3142./a>4) Architecture level code patch1ng interface, 'jump labels'o
L143" class="line" namn>
L143">3143./a>o
L144" class="line" namn>
L144">3144./a>o
L145" class="line" namn>
L145">3145./a>There are a few func"
	 s and macros that architectures must implement in ordero
L146" class="line" namn>
L146">3146./a>to take advantageoof this o2"
miza"
	 . If there is no architecture support, weo
L147" class="line" namn>
L147">3147./a>simply fall back to a tradi"
	 al, load, test, and jump sequence.o
L148" class="line" namn>
L148">3148./a>o
L149" class="line" namn>
L149">3149./a>* select HAVE_ARCH_JUMP_LABEL, see: arch/x86/Kconfigo
L150" class="line" namn>
L150">3150./a>o
L151" class="line" namn>
L151">3151./a>* #define JUMP_LABEL_NOP_SIZE, see: arch/x86/include/asm/jump_label.ho
L152" class="line" namn>
L152">3152./a>o
L153" class="line" namn>
L153">3153./a>* __always_inline bool arch_sta"
c_branch(struct sta"
c_key *key), see:o
L154" class="line" namn>
L154">3154./a>                                        arch/x86/include/asm/jump_label.ho
L155" class="line" namn>
L155">3155./a>o
L156" class="line" namn>
L156">3156./a>* void arch_jump_label_transform(struct jump_entry *entry, enum jump_label_type typn),o
L157" class="line" namn>
L157">3157./a>                                        see: arch/x86/kernel/jump_label.co
L158" class="line" namn>
L158">3158./a>o
L159" class="line" namn>
L159">3159./a>* __init_or_module void arch_jump_label_transform_sta"
c(struct jump_entry *entry, enum jump_label_type typn),o
L160" class="line" namn>
L160">3160./a>                                        see: arch/x86/kernel/jump_label.co
L161" class="line" namn>
L161">3161./a>o
L162" class="line" namn>
L162">3162./a>o
L163" class="line" namn>
L163">3163./a>* struct jump_entry, see: arch/x86/include/asm/jump_label.ho
L164" class="line" namn>
L164">3164./a>o
L165" class="line" namn>
L165">3165./a>o
L166" class="line" namn>
L166">3166./a>5) Sta"
c keys / jump label a alysis, results (x86_64):o
L167" class="line" namn>
L167">3167./a>o
L168" class="line" namn>
L168">3168./a>o
L169" class="line" namn>
L169">3169./a>As an example, let's add the follow1ng branch to 'getppid()', such that theo
L170" class="line" namn>
L170">3170./a>system call now looks like:o
L171" class="line" namn>
L171">3171./a>o
L172" class="line" namn>
L172">3172./a>SYSCALL_DEFINE0(getppid)o
L173" class="line" namn>
L173">3173./a>{o
L174" class="line" namn>
L174">3174./a>        int pid;o
L175" class="line" namn>
L175">3175./a>o
L176" class="line" namn>
L176">3176./a>+       if (sta"
c_key_false(&key))o
L177" class="line" namn>
L177">3177./a>+               printk("I am the true branch\n");o
L178" class="line" namn>
L178">3178./a>o
L179" class="line" namn>
L179">3179./a>        rcu_read_lock();o
L180" class="line" namn>
L180">3180./a>        pid = task_tgid_vnr(rcu_dereference(current->real_parent));o
L181" class="line" namn>
L181">3181./a>        rcu_read_unlock();o
L182" class="line" namn>
L182">3182./a>o
L183" class="line" namn>
L183">3183./a>        return pid;o
L184" class="line" namn>
L184">3184./a>}o
L185" class="line" namn>
L185">3185./a>o
L186" class="line" namn>
L186">3186./a>The result1ng instruct
	 s with jump labels generated by GCC is:o
L187" class="line" namn>
L187">3187./a>o
L188" class="line" namn>
L188">3188./a>ffffffff81044290o<sys_getppid>:o
L189" class="line" namn>
L189">3189./a>ffffffff81044290:       55                      push   %rbpo
L190" class="line" namn>
L190">3190./a>ffffffff81044291:       48 89 e5                mov    %rsp,%rbpo
L191" class="line" namn>
L191">3191./a>ffffffff81044294:       e9 00 00 00 00          jmpq   ffffffff81044299o<sys_getppid+0x9>o
L192" class="line" namn>
L192">3192./a>ffffffff81044299:       65 48 8b 04 25 c0 b6    mov    %gs:0xb6c0,%raxo
L193" class="line" namn>
L193">3193./a>ffffffff810442a0:       00 00o
L194" class="line" namn>
L194">3194./a>ffffffff810442a2:       48 8b 80 80 02 00 00    mov    0x280(%rax),%raxo
L195" class="line" namn>
L195">3195./a>ffffffff810442a9:       48 8b 80 b0 02 00 00    mov    0x2b0(%rax),%raxo
L196" class="line" namn>
L196">3196./a>ffffffff810442b0:       48 8b b8 e8 02 00 00    mov    0x2e8(%rax),%rdio
L197" class="line" namn>
L197">3197./a>ffffffff810442b7:       e8 f4 d9 00 00          callq  ffffffff81051cb0o<pid_vnr>o
L198" class="line" namn>
L198">3198./a>ffffffff810442bc:       5d                      pop    %rbpo
L199" class="line" namn>
L199">3199./a>ffffffff810442bd:       48 98                   cltqo
L200" class="line" namn>
L200">3200./a>ffffffff810442bf:       c3                      retqo
L201" class="line" namn>
L201">3201./a>ffffffff810442c0:       48 c7 c7 e3 54 98 81    mov    $0xffffffff819854e3,%rdio
L202" class="line" namn>
L202">3202./a>ffffffff810442c7:       31 c0                   xor    %eax,%eaxo
L203" class="line" namn>
L203">3203./a>ffffffff810442c9:       e8 71 13 6d 00          callq  ffffffff8171563fo<printk>o
L204" class="line" namn>
L204">3204./a>ffffffff810442ce:       eb c9                   jmp    ffffffff81044299o<sys_getppid+0x9>o
L205" class="line" namn>
L205">3205./a>o
L206" class="line" namn>
L206">3206./a>Without the jump label o2"
miza"
	  it looks like:o
L207" class="line" namn>
L207">3207./a>o
L208" class="line" namn>
L208">3208./a>ffffffff810441f0o<sys_getppid>:o
L209" class="line" namn>
L209">3209./a>ffffffff810441f0:       8b 05 8a 52 d8 00       mov    0xd8528a(%rip),%eax        # ffffffff81dc9480o<key>o
L210" class="line" namn>
L210">3210./a>ffffffff810441f6:       55                      push   %rbpo
L211" class="line" namn>
L211">3211./a>ffffffff810441f7:       48 89 e5                mov    %rsp,%rbpo
L212" class="line" namn>
L212">3212./a>ffffffff810441fa:       85 c0                   test   %eax,%eaxo
L213" class="line" namn>
L213">3213./a>ffffffff810441fc:       75 27                   jne    ffffffff81044225 <sys_getppid+0x35>o
L214" class="line" namn>
L214">3214./a>ffffffff810441fe:       65 48 8b 04 25 c0 b6    mov    %gs:0xb6c0,%raxo
L215" class="line" namn>
L215">3215./a>ffffffff81044205:       00 00o
L216" class="line" namn>
L216">3216./a>ffffffff81044207:       48 8b 80 80 02 00 00    mov    0x280(%rax),%raxo
L217" class="line" namn>
L217">3217./a>ffffffff8104420e:       48 8b 80 b0 02 00 00    mov    0x2b0(%rax),%raxo
L218" class="line" namn>
L218">3218./a>ffffffff81044215:       48 8b b8 e8 02 00 00    mov    0x2e8(%rax),%rdio
L219" class="line" namn>
L219">3219./a>ffffffff8104421c:       e8 2f da 00 00          callq  ffffffff81051c50o<pid_vnr>o
L220" class="line" namn>
L220">3220./a>ffffffff81044221:       5d                      pop    %rbpo
L221" class="line" namn>
L221">3221./a>ffffffff81044222:       48 98                   cltqo
L222" class="line" namn>
L222">3222./a>ffffffff81044224:       c3                      retqo
L223" class="line" namn>
L223">3223./a>ffffffff81044225:       48 c7 c7 13 53 98 81    mov    $0xffffffff81985313,%rdio
L224" class="line" namn>
L224">3224./a>ffffffff8104422c:       31 c0                   xor    %eax,%eaxo
L225" class="line" namn>
L225">3225./a>ffffffff8104422e:       e8 60 0f 6d 00          callq  ffffffff81715193o<printk>o
L226" class="line" namn>
L226">3226./a>ffffffff81044233:       eb c9                   jmp    ffffffff810441fe <sys_getppid+0xe>o
L227" class="line" namn>
L227">3227./a>ffffffff81044235:       66 66 2e 0f 1f 84 00    data32 nopw %cs:0x0(%rax,%rax,1)o
L228" class="line" namn>
L228">3228./a>ffffffff8104423c:       00 00 00 00o
L229" class="line" namn>
L229">3229./a>o
L230" class="line" namn>
L230">3230./a>Thus, the disable jump label case adds a 'mov', 'test' and 'jne' instruct
	 o
L231" class="line" namn>
L231">3231./a>vs. the jump label case just has a 'no-op' or 'jmp 0'. (The jmp 0, is patchedo
L232" class="line" namn>
L232">3232./a>to a 5 byte atom
c no-op instruct
	  at boot-time.) Thus, the disabled jumpo
L233" class="line" namn>
L233">3233./a>label case adds:o
L234" class="line" namn>
L234">3234./a>o
L235" class="line" namn>
L235">3235./a>6 (mov) + 2 (test) + 2 (jne) = 10 - 5 (5 byte jump 0) = 5 addi"
	  bytes.o
L236" class="line" namn>
L236">3236./a>o
L237" class="line" namn>
L237">3237./a>If we then include the padding bytes, the jump label code saves, 16 total byteso
L238" class="line" namn>
L238">3238./a>of instruct
	  memory for this small func"
	 . In this case the non-jump labelo
L239" class="line" namn>
L239">3239./a>func"
	  is 80 bytes long. Thus, we have have saved 20% 	f the instruct
	 o
L240" class="line" namn>
L240">3240./a>footprint. We ca  in fact improve this even further, s1nce the 5-byte no-opo
L241" class="line" namn>
L241">3241./a>really ca  be a 2-byte no-op s1nce we ca  reach the branch with a 2-byte jmp.o
L242" class="line" namn>
L242">3242./a>However, we have not yet implemented o2"
mal no-op s1zes (they are currentlyo
L243" class="line" namn>
L243">3243./a>hard-coded).o
L244" class="line" namn>
L244">3244./a>o
L245" class="line" namn>
L245">3245./a>S1nce there are a number of sta"
c key API uses in the scheduler paths,o
L246" class="line" namn>
L246">3246./a>'pipe-test' (also known as 'perf bench sched pipe') ca  be used to show theo
L247" class="line" namn>
L247">3247./a>performance improvement. Testing done on 3.3.0-rc2:o
L248" class="line" namn>
L248">3248./a>o
L249" class="line" namn>
L249">3249./a>jump label disabled:o
L250" class="line" namn>
L250">3250./a>o
L251" class="line" namn>
L251">3251./a> Performance counter sta"s for 'bash -c /tmp/pipe-test' (50 runs):o
L252" class="line" namn>
L252">3252./a>o
L253" class="line" namn>
L253">3253./a>        855.700314 task-clock                #    0.534 CPUs utilized            ( +-  0.11% )o
L254" class="line" namn>
L254">3254./a>           200,003 context-switches          #    0.234 M/sec                    ( +-  0.00% )o
L255" class="line" namn>
L255">3255./a>                 0 CPU-migrat
	 s            #    0.000 M/sec                    ( +- 39.58% )o
L256" class="line" namn>
L256">3256./a>               487 page-faults               #    0.001 M/sec                    ( +-  0.02% )o
L257" class="line" namn>
L257">3257./a>     1,474,374,262 cycles                    #    1.723 GHz                      ( +-  0.17% )o
L258" class="line" namn>
L258">3258./a>   <not supported> stalled-cycles-frontendo
L259" class="line" namn>
L259">3259./a>   <not supported> stalled-cycles-backendo
L260" class="line" namn>
L260">3260./a>     1,178,049,567 instruct
	 s              #    0.80  ins s per cycle          ( +-  0.06% )o
L261" class="line" namn>
L261">3261./a>       208,368,926 branches                  #  243.507 M/sec                    ( +-  0.06% )o
L262" class="line" namn>
L262">3262./a>         5,569,188 branch-misses             #    2.67% 	f all branches          ( +-  0.54% )o
L263" class="line" namn>
L263">3263./a>o
L264" class="line" namn>
L264">3264./a>       1.601607384 seconds time elapsed                                          ( +-  0.07% )o
L265" class="line" namn>
L265">3265./a>o
L266" class="line" namn>
L266">3266./a>jump label enabled:o
L267" class="line" namn>
L267">3267./a>o
L268" class="line" namn>
L268">3268./a> Performance counter sta"s for 'bash -c /tmp/pipe-test' (50 runs):o
L269" class="line" namn>
L269">3269./a>o
L270" class="line" namn>
L270">3270./a>        841.043185 task-clock                #    0.533 CPUs utilized            ( +-  0.12% )o
L271" class="line" namn>
L271">3271./a>           200,004 context-switches          #    0.238 M/sec                    ( +-  0.00% )o
L272" class="line" namn>
L272">3272./a>                 0 CPU-migrat
	 s            #    0.000 M/sec                    ( +- 40.87% )o
L273" class="line" namn>
L273">3273./a>               487 page-faults               #    0.001 M/sec                    ( +-  0.05% )o
L274" class="line" namn>
L274">3274./a>     1,432,559,428 cycles                    #    1.703 GHz                      ( +-  0.18% )o
L275" class="line" namn>
L275">3275./a>   <not supported> stalled-cycles-frontendo
L276" class="line" namn>
L276">3276./a>   <not supported> stalled-cycles-backendo
L277" class="line" namn>
L277">3277./a>     1,175,363,994 instruct
	 s              #    0.82  ins s per cycle          ( +-  0.04% )o
L278" class="line" namn>
L278">3278./a>       206,859,359 branches                  #  245.956 M/sec                    ( +-  0.04% )o
L279" class="line" namn>
L279">3279./a>         4,884,119 branch-misses             #    2.36% 	f all branches          ( +-  0.85% )o
L280" class="line" namn>
L280">3280./a>o
L281" class="line" namn>
L281">3281./a>       1.579384366 seconds time elapsedo
L282" class="line" namn>
L282">3282./a>o
L283" class="line" namn>
L283">3283./a>The percentageoof saved branches is .7%, and we've saved 12% 	 o
L284" class="line" namn>
L284">3284./a>'branch-misses'. This is where we would expect to get the most savings, s1nceo
L285" class="line" namn>
L285">3285./a>this o2"
miza"
	  is about reduc1ng the number of branches. In addi"
	 , we'veo
L286" class="line" namn>
L286">3286./a>saved .2% 	  instruct
	 s, and 2.8% 	  cycles and 1.4% 	  elapsed time.o
L287" class="line" namn>
L287">3287./a>
lxr.linux.no kindly hosted by Redpill Linpro AS./a>, provider of Linux consult1ng and operat s services s1nce 1995.