Reduce lock contention in the NFS client
Get series with b4
b4 am [email protected] change-id 20260831-performance-e465e621c1c0Versions newest first
- v3 Latest4 patches 2 repliesIn review
- v2 RFC8 patches 2 repliesSuperseded
- v1 RFC8 patches 17 repliesSuperseded
Changes in v3 from the cover letter
- Drop the WQ_AFFN_SMT scope patches (Tim Menninger's regression report)
- Rebase on v7.3-rc2
- Link to v2: https://patch.msgid.link/[email protected]
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | SUNRPC: Use atomic_t for XID allocationinclude/ net/ | +3 | 0 replies | |
| 2/4 | SUNRPC: Split recv_lock out of xprt->queue_lockinclude/ net/ net/ +3 more | +77 | 0 replies | |
| 3/4 | SUNRPC: Set WQ_SYSFS on rpciod and xprtiodnet/ | +3 | 0 replies | |
| 4/4 | NFS: Set WQ_SYSFS on nfsiodfs/ | +2 | 0 replies |
Reviews trailers per patch
None of the 4 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Jeff Layton | Tim Menninger |
|---|---|---|
| Series | R-b | R-b T-b |
| 1/4 | ||
| 2/4 | ||
| 3/4 | ||
| 4/4 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/4] Reduce lock contention in the NFS client
Under a 4KB NFSv3 workload on 100GbE RDMA, roughly 150 RPC worker threads drive the client, and lock contention dominates its CPU
profile: up to 53% of non-idle cycles are spent in native_queued_spin_lock_slowpath.
Three locks account for that: reserve_lock on every XID allocation, queue_lock on every submit and completion, and the unbound worker pool lock on every enqueue and dequeue for rpciod, nfsiod, and xprtiod.
This series addresses the first two. v2 also moved the three workqueues to the WQ_AFFN_SMT scope. Tim Menninger reported an intermittent throughput regression on a 96-CPU two-socket NFS/RDMA client and bisected it to the rpciod scope change [1]. The cause is still being worked out in that thread, so the scope patches are withdrawn until it is understood. Until then, WQ_SYSFS on all three workqueues lets an administrator set the scope from user space.
[1] https://lore.kernel.org/linux-nfs/[email protected]/
---
Changes in v3:
- Drop the WQ_AFFN_SMT scope patches (Tim Menninger's regression report)
- Rebase on v7.3-rc2
- Link to v2: https://patch.msgid.link/[email protected]
Changes in v2:
- Fix send bvec use-after-free in xprt_request_dequeue_xprt() (sashiko)
- Replace the three workqueue exports with workqueue_set_affn_scope()
- Split the WQ_SYSFS patch into SUNRPC and NFS patches
- Drop v1 patch 2: async completions in the submitter can deadlock
- Correct the pool cost and SMT group wording in the scope patches
- Link to v1: https://patch.msgid.link/[email protected]
---
Chuck Lever (4):
SUNRPC: Use atomic_t for XID allocation
SUNRPC: Split recv_lock out of xprt->queue_lock
SUNRPC: Set WQ_SYSFS on rpciod and xprtiod
NFS: Set WQ_SYSFS on nfsiod
fs/nfs/inode.c | 3 +- include/linux/sunrpc/xprt.h | 8 ++- net/sunrpc/sched.c | 5 +- net/sunrpc/svcsock.c | 6 +-- net/sunrpc/xprt.c | 85 ++++++++++++++++++------------ net/sunrpc/xprtrdma/rpc_rdma.c | 14 ++--- net/sunrpc/xprtrdma/svc_rdma_backchannel.c | 8 +-- net/sunrpc/xprtsock.c | 18 +++---- 8 files changed, 85 insertions(+), 62 deletions(-)
---
base-commit: df2908090cda368b01ff43709f51890076c56157
change-id: 20260831-performance-e465e621c1c0
Best regards,
Signature · 1 line
Chuck Lever