summaryrefslogtreecommitdiff
path: root/scripts/include
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2026-05-06 18:26:51 +0300
committerChuck Lever <cel@kernel.org>2026-06-09 23:32:59 +0300
commit58202c29de9360a2b255458892e08a252d4406be (patch)
tree8084840073202911766dc7c71c7a6b392d5cfeb3 /scripts/include
parent9545262f7e58d67de413d5a47ea2a3f2e59ba9f6 (diff)
downloadlinux-58202c29de9360a2b255458892e08a252d4406be.tar.xz
svcrdma: Defer send context release to xpo_release_ctxt
Send completion currently queues a work item to an unbound workqueue for each completed send context. Under load, the Send Completion handlers contend for the shared workqueue pool lock. Replace the workqueue with a per-transport lock-free list (llist). The Send completion handler appends the send_ctxt to sc_send_release_list and does no further teardown. The nfsd thread drains the list in xpo_release_ctxt between RPCs, performing DMA unmapping, chunk I/O resource release, and page release in a batch. This eliminates both the workqueue pool lock and the DMA unmap cost from the Send completion path. DMA unmapping can be expensive when an IOMMU is present in strict mode, as each unmap triggers a synchronous hardware IOTLB invalidation. Moving it to the nfsd thread, where that latency is harmless, avoids penalizing completion handler throughput. The nfsd threads absorb the release cost at a point where the client is no longer waiting on a reply, and natural batching amortizes the overhead when completions arrive faster than RPCs complete. A self-enqueue backstops drain on a quiescing transport. When svc_rdma_send_ctxt_put() observes that its llist_add() transitions sc_send_release_list from empty to non-empty, it sets XPT_DATA and calls svc_xprt_enqueue() so that svc_xprt_ready() schedules an nfsd thread. The thread enters svc_rdma_recvfrom(), finds no pending receive, clears XPT_DATA, and returns 0; svc_xprt_release() then runs xpo_release_ctxt and drains the list. Under steady load the foreground drain keeps the list non-empty between adds and no enqueue fires; only the trailing edge of a burst pays for a wakeup. Without this path, a Send completion arriving after the last xpo_release_ctxt on an idle connection would leave the send_ctxt's DMA mappings and reply pages pinned until the next RPC, send-context exhaustion, or transport close. Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'scripts/include')
0 files changed, 0 insertions, 0 deletions