netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/2] optimise UDP skb completion wakeups
@ 2024-02-07 14:23 Pavel Begunkov
  2024-02-07 14:23 ` [RFC 1/2] udp: introduce udp specific skb destructor Pavel Begunkov
  2024-02-07 14:23 ` [RFC 2/2] udp: optimise write wakeups with SOCK_NOSPACE Pavel Begunkov
  0 siblings, 2 replies; 3+ messages in thread
From: Pavel Begunkov @ 2024-02-07 14:23 UTC (permalink / raw)
  To: netdev, edumazet, davem, dsahern, pabeni, kuba; +Cc: Pavel Begunkov

sock_wfree() tries to wake even when there are only read waiters and no
write waiters, which is the common scenario for io_uring. It'd also
attempt to wake if the write queue is far from being full. To avoid most
of this overhead add SOCK_NOSPACE support for UDP.

It brings +5% to UDP throughput with a CPU bound benchmark, and I observed
it taking 0.5-2% according to profiles in more realistic workloads.

Patch 1 introduces a new destructor udp_wfree(). The optimisation can be
implemented in sock_wfree() but that would either require patching up all
poll callbacks across the tree that are used in couple with sock_wfree(),
or limiting it to UDP with a flag.

Another option considered was to split out a write waitqueue, perhaps
conditionally, but it's bulkier, and the current version should also
benefit epoll workloads.

Pavel Begunkov (2):
  udp: introduce udp specific skb destructor
  udp: optimise write wakeups with SOCK_NOSPACE

 drivers/net/veth.c | 10 +++++---
 include/net/sock.h |  1 +
 include/net/udp.h  |  1 +
 net/core/sock.c    | 10 +++++---
 net/ipv4/udp.c     | 58 ++++++++++++++++++++++++++++++++++++++++++++--
 net/ipv6/udp.c     |  5 +++-
 6 files changed, 76 insertions(+), 9 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2024-02-07 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-07 14:23 [RFC 0/2] optimise UDP skb completion wakeups Pavel Begunkov
2024-02-07 14:23 ` [RFC 1/2] udp: introduce udp specific skb destructor Pavel Begunkov
2024-02-07 14:23 ` [RFC 2/2] udp: optimise write wakeups with SOCK_NOSPACE Pavel Begunkov

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).