From: Paolo Abeni <pabeni@redhat.com>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
James Morris <jmorris@namei.org>,
Trond Myklebust <trond.myklebust@primarydata.com>,
Alexander Duyck <aduyck@mirantis.com>,
Daniel Borkmann <daniel@iogearbox.net>,
Eric Dumazet <edumazet@google.com>,
Tom Herbert <tom@herbertland.com>,
Hannes Frederic Sowa <hannes@stressinduktion.org>,
Edward Cree <ecree@solarflare.com>,
linux-nfs@vger.kernel.org
Subject: [PATCH net-next v4 0/3] udp: refactor memory accounting
Date: Wed, 19 Oct 2016 14:46:59 +0200 [thread overview]
Message-ID: <cover.1476877189.git.pabeni@redhat.com> (raw)
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)
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/linux/udp.h | 1 +
include/net/sock.h | 4 ++
include/net/udp.h | 4 ++
net/core/datagram.c | 36 +++++++-----
net/core/sock.c | 66 +++++++++++++++-------
net/ipv4/udp.c | 153 +++++++++++++++++++++++++++++++++++++++-----------
net/ipv6/udp.c | 34 +++--------
net/sunrpc/svcsock.c | 20 +++++--
net/sunrpc/xprtsock.c | 2 +-
9 files changed, 221 insertions(+), 99 deletions(-)
--
1.8.3.1
next reply other threads:[~2016-10-19 15:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-19 12:46 Paolo Abeni [this message]
2016-10-19 12:47 ` [PATCH net-next v4 2/3] udp: implement memory accounting helpers Paolo Abeni
2016-10-20 4:43 ` Eric Dumazet
[not found] ` <1476938622.5650.111.camel-XN9IlZ5yJG9HTL0Zs8A6p+yfmBU6pStAUsxypvmhUTTZJqsBc5GL+g@public.gmane.org>
2016-10-20 7:02 ` Paolo Abeni
2016-10-20 10:18 ` Paolo Abeni
[not found] ` <cover.1476877189.git.pabeni-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-10-19 12:47 ` [PATCH net-next v4 1/3] net/socket: factor out helpers for memory and queue manipulation Paolo Abeni
2016-10-19 12:47 ` [PATCH net-next v4 3/3] udp: use it's own memory accounting schema Paolo Abeni
2016-10-20 1:54 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1476877189.git.pabeni@redhat.com \
--to=pabeni@redhat.com \
--cc=aduyck@mirantis.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=ecree@solarflare.com \
--cc=edumazet@google.com \
--cc=hannes@stressinduktion.org \
--cc=jmorris@namei.org \
--cc=linux-nfs@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tom@herbertland.com \
--cc=trond.myklebust@primarydata.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).