sunrpc: Reduce lock contention for NFSD TCP sockets
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest8 patches 0 repliesNew
- v1 RFC7 patches 3 repliesSuperseded
Changes since RFC from the cover letter
- Drop the affinity scope patch
- Skip user memory hardening for kernel-to-kernel copies
- Avoid invoking wake_up when the receive is already running
- Refactor svc_tcp_receiver_thread() for legibility
- Do not set MSG_MORE during batched sends
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | sunrpc: Add XPT flags missing from SVC_XPRT_FLAG_LISTinclude/ | +3 | 0 replies | |
| 2/8 | net: datagram: bypass usercopy checks for kernel iteratorsnet/ | +13 | 0 replies | |
| 3/8 | sunrpc: split svc_data_ready into protocol-specific callbacksinclude/ net/ | +35 | 0 replies | |
| 4/8 | sunrpc: add per-transport page recycling poolinclude/ include/ net/ +1 more | +197 | 0 replies | |
| 5/8 | sunrpc: add dedicated TCP receiver threadinclude/ net/ | +498 | 0 replies | |
| 6/8 | sunrpc: implement flat combining for TCP socket sendsinclude/ net/ | +158 | 0 replies | |
| 7/8 | sunrpc: unify fore and backchannel server TCP send pathsinclude/ net/ net/ | +71 | 0 replies | |
| 8/8 | sunrpc: Set explicit TCP socket buffer sizes for NFSDnet/ | +48 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/8] sunrpc: Reduce lock contention for NFSD TCP sockets
From: Chuck Lever <[email protected]>
High-throughput NFSD workloads exhibit significant lock contention on TCP connections. Worker threads compete for the socket lock during receives and serialize on xpt_mutex during sends, limiting scalability.
This series addresses both paths:
- Receive: A dedicated kernel thread per TCP connection owns all sock_recvmsg() calls and queues complete RPC messages for workers via lock-free llist. This eliminates socket lock contention among workers.
- Transmit: Flat combining allows one thread to send on behalf of multiple waiters. Threads enqueue requests; the mutex holder ("combiner") processes the batch, amortizing lock acquisition and enabling TCP segment coalescing via MSG_MORE.
Supporting changes include a page recycling pool for receive buffers, and explicit TCP buffer sizing for high bandwidth-delay product networks.
Base commit: v6.19
URL: https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/log/?h=svctcp-next
---
Changes since RFC:
- Drop the affinity scope patch
- Skip user memory hardening for kernel-to-kernel copies
- Avoid invoking wake_up when the receive is already running
- Refactor svc_tcp_receiver_thread() for legibility
- Do not set MSG_MORE during batched sends
Chuck Lever (8):
sunrpc: Add XPT flags missing from SVC_XPRT_FLAG_LIST
net: datagram: bypass usercopy checks for kernel iterators
sunrpc: split svc_data_ready into protocol-specific callbacks
sunrpc: add per-transport page recycling pool
sunrpc: add dedicated TCP receiver thread
sunrpc: implement flat combining for TCP socket sends
sunrpc: unify fore and backchannel server TCP send paths
sunrpc: Set explicit TCP socket buffer sizes for NFSD
include/linux/sunrpc/svc.h | 1 + include/linux/sunrpc/svc_xprt.h | 32 ++ include/linux/sunrpc/svcsock.h | 40 ++ include/trace/events/sunrpc.h | 7 +- net/core/datagram.c | 15 +- net/sunrpc/svc.c | 13 + net/sunrpc/svc_xprt.c | 151 ++++++ net/sunrpc/svcsock.c | 802 +++++++++++++++++++++++++++++--- net/sunrpc/xprtsock.c | 60 +-- 9 files changed, 999 insertions(+), 122 deletions(-)
Signature · 1 line
2.52.0