• Tom Herbert's avatar
    net: Performance fix for process_backlog · 11ef7a89
    Tom Herbert authored
    In process_backlog the input_pkt_queue is only checked once for new
    packets and quota is artificially reduced to reflect precisely the
    number of packets on the input_pkt_queue so that the loop exits
    appropriately.
    
    This patches changes the behavior to be more straightforward and
    less convoluted. Packets are processed until either the quota
    is met or there are no more packets to process.
    
    This patch seems to provide a small, but noticeable performance
    improvement. The performance improvement is a result of staying
    in the process_backlog loop longer which can reduce number of IPI's.
    
    Performance data using super_netperf TCP_RR with 200 flows:
    
    Before fix:
    
    88.06% CPU utilization
    125/190/309 90/95/99% latencies
    1.46808e+06 tps
    1145382 intrs.sec.
    
    With fix:
    
    87.73% CPU utilization
    122/183/296 90/95/99% latencies
    1.4921e+06 tps
    1021674.30 intrs./sec.
    Signed-off-by: default avatarTom Herbert <therbert@google.com>
    Acked-by: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    11ef7a89
dev.c 178 KB