All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] udp: reduce cache pressure
@ 2017-05-29 15:27 Paolo Abeni
  2017-05-29 15:27 ` [PATCH net-next 1/3] net: factor out a helper to decrement the skb refcount Paolo Abeni
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Paolo Abeni @ 2017-05-29 15:27 UTC (permalink / raw)
  To: netdev; +Cc: David S. Miller, Eric Dumazet

In the most common use case, many skb fields are not used by recvmsg(), and
the few ones actually accessed lays on cold cachelines, which leads to several
cache miss per packet.

This patch series attempts to reduce such misses with different strategies:
* caching the interesting fields in the scratched space
* avoid accessing at all uninteresting fields
* prefetching

Tested using the udp_sink program by Jesper[1] as the receiver, an h/w l4 rx
hash on the ingress nic, so that the number of ingress nic rx queues hit by the
udp traffic could be controlled via ethtool -L.

The udp_sink program was bound to the first idle cpu, to get more
stable numbers.

On a single numa node receiver:

nic rx queues           vanilla                 patched kernel      delta
1                       1850 kpps               1850 kpps           0%
2                       2370 kpps               2700 kpps           13.9%
16                      2000 kpps               2220 kpps           11%

[1] https://github.com/netoptimizer/network-testing/blob/master/src/udp_sink.c

Paolo Abeni (3):
  net: factor out a helper to decrement the skb refcount
  udp: avoid a cache miss on dequeue
  udp: try to avoid 2 cache miss on dequeue

 include/linux/skbuff.h |  14 ++++++
 net/core/datagram.c    |   4 +-
 net/core/skbuff.c      |  32 ++++++++-----
 net/ipv4/udp.c         | 120 ++++++++++++++++++++++++++++++++++++++++++++-----
 4 files changed, 145 insertions(+), 25 deletions(-)

-- 
2.9.4

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2017-06-30  6:55 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-29 15:27 [PATCH net-next 0/3] udp: reduce cache pressure Paolo Abeni
2017-05-29 15:27 ` [PATCH net-next 1/3] net: factor out a helper to decrement the skb refcount Paolo Abeni
2017-05-31 16:56   ` Eric Dumazet
2017-05-29 15:27 ` [PATCH net-next 2/3] udp: avoid a cache miss on dequeue Paolo Abeni
2017-05-31 17:00   ` Eric Dumazet
2017-06-01 10:39     ` Paolo Abeni
2017-06-01 15:58       ` Eric Dumazet
2017-06-01 16:21         ` Paolo Abeni
2017-06-01 16:40           ` Eric Dumazet
2017-06-01 20:35             ` Paolo Abeni
2017-06-01 20:50               ` Eric Dumazet
2017-05-29 15:27 ` [PATCH net-next 3/3] udp: try to avoid 2 " Paolo Abeni
2017-05-31 17:04   ` Eric Dumazet
2017-06-01 10:46     ` Paolo Abeni
2017-06-07  2:12   ` [lkp-robot] [udp] bc0d3d0639: apachebench.requests_per_second -21% regression kernel test robot
2017-06-07  2:12     ` kernel test robot
2017-06-07 21:40     ` Paolo Abeni
2017-06-09 15:35       ` Paolo Abeni
2017-06-30  6:55         ` Ye Xiaolong
2017-05-31 16:47 ` [PATCH net-next 0/3] udp: reduce cache pressure David Miller
2017-05-31 16:52   ` Eric Dumazet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.