All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v6 0/3] udp: refactor memory accounting
@ 2016-10-21 11:55 Paolo Abeni
  2016-10-21 11:55 ` [PATCH net-next v6 1/3] net/socket: factor out helpers for memory and queue manipulation Paolo Abeni
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Paolo Abeni @ 2016-10-21 11:55 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, James Morris, Trond Myklebust, Alexander Duyck,
	Daniel Borkmann, Eric Dumazet, Tom Herbert, Hannes Frederic Sowa,
	Edward Cree, linux-nfs

This patch series refactor the udp memory accounting, replacing the
generic implementation with a custom one, in order to remove the needs for
locking the socket on the enqueue and dequeue operations. The socket backlog
usage is dropped, as well.

The first patch factor out pieces of some queue and memory management
socket helpers, so that they can later be used by the udp memory accounting
functions.
The second patch adds the memory account helpers, without using them.
The third patch replacse the old rx memory accounting path for udp over ipv4 and
udp over ipv6. In kernel UDP users are updated, as well.

The memory accounting schema is described in detail in the individual patch
commit message.

The performance gain depends on the specific scenario; with few flows (and
little contention in the original code) the differences are in the noise range,
while with several flows contending the same socket, the measured speed-up
is relevant (e.g. even over 100% in case of extreme contention)

Many thanks to Eric Dumazet for the reiterated reviews and suggestions.

v5 -> v6:
 - do not orphan the skb on enqueue, skb_steal_sock() already did
   the work for us

v4 -> v5:
 - use the receive queue spin lock to protect the memory accounting
 - several minor clean-up

v3 -> v4:
 - simplified the locking schema, always use a plain spinlock

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

v1 -> v2:
 - changed slighly the memory accounting schema, we now perform lazy reclaim
 - fixed forward_alloc updating issue
 - fixed memory counter integer overflows

Paolo Abeni (3):
  net/socket: factor out helpers for memory and queue manipulation
  udp: implement memory accounting helpers
  udp: use it's own memory accounting schema

 include/net/sock.h    |   4 ++
 include/net/udp.h     |   4 ++
 net/core/datagram.c   |  36 +++++++-----
 net/core/sock.c       |  64 +++++++++++++++-------
 net/ipv4/udp.c        | 149 ++++++++++++++++++++++++++++++++++++++------------
 net/ipv6/udp.c        |  34 +++---------
 net/sunrpc/svcsock.c  |  20 +++++--
 net/sunrpc/xprtsock.c |   2 +-
 8 files changed, 214 insertions(+), 99 deletions(-)

-- 
1.8.3.1

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

end of thread, other threads:[~2016-10-22 20:50 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-21 11:55 [PATCH net-next v6 0/3] udp: refactor memory accounting Paolo Abeni
2016-10-21 11:55 ` [PATCH net-next v6 1/3] net/socket: factor out helpers for memory and queue manipulation Paolo Abeni
     [not found]   ` <14784e6382342c2184929ef2959e7c11faf8ff8e.1477043395.git.pabeni-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-10-21 21:13     ` Eric Dumazet
2016-10-21 21:13       ` Eric Dumazet
2016-10-21 11:55 ` [PATCH net-next v6 2/3] udp: implement memory accounting helpers Paolo Abeni
     [not found]   ` <4d2e0fc8f5c3d1309b0fb71bc65a2719a8e82825.1477043395.git.pabeni-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-10-21 12:24     ` Eric Dumazet
2016-10-21 12:24       ` Eric Dumazet
     [not found]       ` <1477052642.7065.63.camel-XN9IlZ5yJG9HTL0Zs8A6p+yfmBU6pStAUsxypvmhUTTZJqsBc5GL+g@public.gmane.org>
2016-10-21 13:34         ` Paolo Abeni
2016-10-21 13:34           ` Paolo Abeni
     [not found]           ` <1477056841.4606.36.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-10-21 13:41             ` Eric Dumazet
2016-10-21 13:41               ` Eric Dumazet
2016-10-21 21:13   ` Eric Dumazet
     [not found] ` <cover.1477043395.git.pabeni-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-10-21 11:55   ` [PATCH net-next v6 3/3] udp: use it's own memory accounting schema Paolo Abeni
2016-10-21 11:55     ` Paolo Abeni
     [not found]     ` <530de0874eb7bbe1dbdaa4e8ccbb56d917ee598f.1477043395.git.pabeni-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-10-21 21:14       ` Eric Dumazet
2016-10-21 21:14         ` Eric Dumazet
2016-10-22 20:50   ` [PATCH net-next v6 0/3] udp: refactor memory accounting David Miller
2016-10-22 20:50     ` David Miller

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.