]> git.baikalelectronics.ru Git - kernel.git/commit
net: Use __this_cpu_inc() in fast path
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 19 May 2010 22:07:23 +0000 (22:07 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 May 2010 07:24:01 +0000 (00:24 -0700)
commit919b639c7c9c0c7d34450a2a5ecf0566c1dd9619
tree49cca2881bcd9212cd99a1e30c83f40a20eefc55
parent09cac67618e884123943cee7626db6af5d067acb
net: Use __this_cpu_inc() in fast path

This patch saves 224 bytes of text on my machine.

__this_cpu_inc() generates a single instruction, using no scratch
registers :

  65 ff 04 25 a8 30 01 00      incl   %gs:0x130a8

instead of :

  48 c7 c2 80 30 01 00         mov    $0x13080,%rdx
  65 48 8b 04 25 88 ea 00 00   mov    %gs:0xea88,%rax
  83 44 10 28 01               addl   $0x1,0x28(%rax,%rdx,1)

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c
net/ipv4/route.c