diff options
| author | Chuck Lever <chuck.lever@oracle.com> | 2026-05-06 11:26:50 -0400 |
|---|---|---|
| committer | Chuck Lever <chuck.lever@oracle.com> | 2026-05-28 11:31:26 -0400 |
| commit | 0c6e7d85577b3052d5f8755684eaec379c4d92e2 (patch) | |
| tree | 7eeeedb2b8d97619c41665ae857b2110beedd020 /net | |
| parent | aa54f6f1a8011a8df40d07a3cc2d3a85d7aae581 (diff) | |
| download | linux-next-history-0c6e7d85577b3052d5f8755684eaec379c4d92e2.tar.gz | |
svcrdma: Release write chunk resources without re-queuing
Each RDMA Send completion triggers a cascade of work items on the
svcrdma_wq unbound workqueue:
ib_cq_poll_work (on ib_comp_wq, per-CPU)
-> svc_rdma_send_ctxt_put -> queue_work [work item 1]
-> svc_rdma_write_info_free -> queue_work [work item 2]
Every transition through queue_work contends on the unbound
pool's spinlock. Profiling an 8KB NFSv3 read/write workload
over RDMA shows about 4% of total CPU cycles spent on this
lock, with the cascading re-queue of write_info release
contributing roughly 1%.
The initial queue_work in svc_rdma_send_ctxt_put is needed to
move release work off the CQ completion context (which runs on
a per-CPU bound workqueue). However, once executing on
svcrdma_wq, there is no need to re-queue for each write_info
structure. svc_rdma_reply_chunk_release already calls
svc_rdma_cc_release inline from the same svcrdma_wq context,
and svc_rdma_recv_ctxt_put does the same from nfsd thread
context.
Release write chunk resources inline in
svc_rdma_write_info_free, removing the intermediate
svc_rdma_write_info_free_async work item and the wi_work
field from struct svc_rdma_write_info.
Reviewed-by: Mike Snitzer <snitzer@kernel.org>
Tested-by: Jonathan Flynn <jonathan.flynn@hammerspace.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'net')
| -rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_rw.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/net/sunrpc/xprtrdma/svc_rdma_rw.c b/net/sunrpc/xprtrdma/svc_rdma_rw.c index 402e2ceca4ff7..cca8ec973de4b 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_rw.c +++ b/net/sunrpc/xprtrdma/svc_rdma_rw.c @@ -236,21 +236,12 @@ svc_rdma_write_info_alloc(struct svcxprt_rdma *rdma, return info; } -static void svc_rdma_write_info_free_async(struct work_struct *work) +static void svc_rdma_write_info_free(struct svc_rdma_write_info *info) { - struct svc_rdma_write_info *info; - - info = container_of(work, struct svc_rdma_write_info, wi_work); svc_rdma_cc_release(info->wi_rdma, &info->wi_cc, DMA_TO_DEVICE); kfree(info); } -static void svc_rdma_write_info_free(struct svc_rdma_write_info *info) -{ - INIT_WORK(&info->wi_work, svc_rdma_write_info_free_async); - queue_work(svcrdma_wq, &info->wi_work); -} - /** * svc_rdma_write_chunk_release - Release Write chunk I/O resources * @rdma: controlling transport |
