title: Big difference in overhead caused by instructions in straight-line code
body: <p>I am trying to understand the overhead in <code>[blk_account_io_completion][1]</code> in Linux block layer. Using <code>perf annotate</code> I get the following snippet (abridged). Can someone shed some light on the reason the <code>add</code> and <code>test</code> instruction have such overheads compared to their neighboring instruction which are executed with them?</p>
  
  <pre><code>         :                      part_stat_add(cpu, part, sectors[rw], bytes &gt;&gt; 9);
      0.13 :        ffffffff813336eb:       movsxd r8,r8d
      0.00 :        ffffffff813336ee:       lea    rdx,[rax*8+0x0]
      0.00 :        ffffffff813336f6:       mov    rcx,QWORD PTR [rdi+0x210]
     72.04 :        ffffffff813336fd:       add    rcx,QWORD PTR [r8*8-0x7e2df6a0]
      0.22 :        ffffffff81333705:       add    QWORD PTR [rcx+rdx*1],rsi
      0.61 :        ffffffff81333709:       mov    eax,DWORD PTR [rdi+0x1f4]
     26.52 :        ffffffff8133370f:       test   eax,eax
      0.00 :        ffffffff81333711:       je     ffffffff81333733 &lt;blk_account_io_completion+0x83&gt;
  </code></pre>