]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
udp: use it's own memory accounting schema
authorPaolo Abeni <pabeni@redhat.com>
Fri, 21 Oct 2016 11:55:47 +0000 (13:55 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 22 Oct 2016 21:05:05 +0000 (17:05 -0400)
commit850cbaddb52dfd4e0c7cabe2c168dd34b44ae0b9
treebdb5f6df459764e4a78d835200917d90c3330652
parentf970bd9e3a06f06df8d8ecf1f8ad2c8615cc17eb
udp: use it's own memory accounting schema

Completely avoid default sock memory accounting and replace it
with udp-specific accounting.

Since the new memory accounting model encapsulates completely
the required locking, remove the socket lock on both enqueue and
dequeue, and avoid using the backlog on enqueue.

Be sure to clean-up rx queue memory on socket destruction, using
udp its own sk_destruct.

Tested using pktgen with random src port, 64 bytes packet,
wire-speed on a 10G link as sender and udp_sink as the receiver,
using an l4 tuple rxhash to stress the contention, and one or more
udp_sink instances with reuseport.

nr readers      Kpps (vanilla)  Kpps (patched)
1               170             440
3               1250            2150
6               3000            3650
9               4200            4450
12              5700            6250

v4 -> v5:
  - avoid unneeded test in first_packet_length

v3 -> v4:
  - remove useless sk_rcvqueues_full() call

v2 -> v3:
  - do not set the now unsed backlog_rcv callback

v1 -> v2:
  - add memory pressure support
  - fixed dropwatch accounting for ipv6

Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp.c
net/ipv6/udp.c
net/sunrpc/svcsock.c
net/sunrpc/xprtsock.c