Skip to content

Commit 5581cf8

Browse files
committed
SUNRPC: Optimize page release in svc_rdma_sendto()
Now that we have bulk page allocation and release APIs, it's more efficient to use those than it is for nfsd threads to wait for send completions. Previous patches have eliminated the calls to wait_for_completion() and complete(), in order to avoid scheduler overhead. Now release pages-under-I/O in the send completion handler using the efficient bulk release API. I've measured a 7% reduction in cumulative CPU utilization in svc_rdma_sendto(), svc_rdma_wc_send(), and svc_xprt_release(). In particular, using release_pages() instead of complete() cuts the time per svc_rdma_wc_send() call by two-thirds. This helps improve scalability because svc_rdma_wc_send() is single-threaded per connection. Reviewed-by: Tom Talpey <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent baf6d18 commit 5581cf8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/sunrpc/xprtrdma/svc_rdma_sendto.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ void svc_rdma_send_ctxt_put(struct svcxprt_rdma *rdma,
236236
struct ib_device *device = rdma->sc_cm_id->device;
237237
unsigned int i;
238238

239-
for (i = 0; i < ctxt->sc_page_count; ++i)
240-
put_page(ctxt->sc_pages[i]);
239+
if (ctxt->sc_page_count)
240+
release_pages(ctxt->sc_pages, ctxt->sc_page_count);
241241

242242
/* The first SGE contains the transport header, which
243243
* remains mapped until @ctxt is destroyed.

0 commit comments

Comments
 (0)