ipv4: __mkroute_output() speedup
authorEric Dumazet <eric.dumazet@gmail.com>
Wed, 29 Sep 2010 11:53:50 +0000 (11:53 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Oct 2010 00:59:30 +0000 (17:59 -0700)
commitdd28d1a0b5ecc0f5512f658b1a8fd38bc4f4c98c
tree5cee646dfe354803f0b6f7b9ddd11c189c4ee8e3
parente1a5964f0c32a75b17360cfc565d25aaedbff747
ipv4: __mkroute_output() speedup

While doing stress tests with a disabled IP route cache, I found
__mkroute_output() was touching three times in_device atomic refcount.

Use RCU to touch it once to reduce cache line ping pongs.

Before patch

time to perform the test
real 1m42.009s
user 0m12.545s
sys 25m0.726s

Profile :

16109.00 26.4% ip_route_output_slow   vmlinux
 7434.00 12.2% dst_destroy            vmlinux
 3280.00  5.4% fib_rules_lookup       vmlinux
 3252.00  5.3% fib_semantic_match     vmlinux
 2622.00  4.3% fib_table_lookup       vmlinux
 2535.00  4.1% dst_alloc              vmlinux
 1750.00  2.9% _raw_read_lock         vmlinux
 1532.00  2.5% rt_set_nexthop         vmlinux

After patch

real 1m36.503s
user 0m12.977s
sys 23m25.608s

14234.00 22.4% ip_route_output_slow   vmlinux
 8717.00 13.7% dst_destroy            vmlinux
 4052.00  6.4% fib_rules_lookup       vmlinux
 3951.00  6.2% fib_semantic_match     vmlinux
 3191.00  5.0% dst_alloc              vmlinux
 1764.00  2.8% fib_table_lookup       vmlinux
 1692.00  2.7% _raw_read_lock         vmlinux
 1605.00  2.5% rt_set_nexthop         vmlinux

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