net: Performance fix for process_backlog
authorTom Herbert <therbert@google.com>
Mon, 30 Jun 2014 16:50:40 +0000 (09:50 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 8 Jul 2014 02:24:34 +0000 (19:24 -0700)
commit11ef7a8996d5d433c9cd75d80651297eccbf6d42
treed0e9606987ba8a5d35429c0e61c9610ac7448eed
parent68b7107b62983f2cff0948292429d5f5999df096
net: Performance fix for process_backlog

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: Tom Herbert <therbert@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c