• Eric Dumazet's avatar
    ipv4: __mkroute_output() speedup · dd28d1a0
    Eric Dumazet authored
    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: default avatarEric Dumazet <eric.dumazet@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    dd28d1a0
route.c 82.1 KB