Skip to contentSkip to conversation

svcrdma: Optimize the logic that selects the R_key to invalidate

PATCH Superseded Chuck Lever 1 participant 1 message Dec 3, 2018

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 svcrdma: Optimize the logic that selects the R_key to invalidate

Make two minor optimizations:

o Select the R_key to invalidate while the CPU cache still contains the received RPC Call transport header, rather than waiting until we're about to send the RPC Reply.

o Choose Send With Invalidate if there is exactly one distinct R_key in the received transport header.

The reason for the second change:

Remote invalidation can invalidate only a single R_key. If the RPC has multiple R_keys, the Receive completion will wait for the remote invalidation, and then the RPC completion will wait for the local invalidations. Waiting twice takes longer.

This change improves the throughput of large I/Os by a few percent, and has no effect on smaller I/Os.

---

Posting one more time for review.

Changes since v1:
- Patch description updates suggested by [email protected]
- Continuous testing on 4.20-rc4 and -rc5

 include/linux/sunrpc/svc_rdma.h         |    1 
 net/sunrpc/xprtrdma/svc_rdma_recvfrom.c |   63 +++++++++++++++++++++++++++++++
 net/sunrpc/xprtrdma/svc_rdma_sendto.c   |   53 ++++++--------------------
 3 files changed, 77 insertions(+), 40 deletions(-)
include/linux/sunrpc/svc_rdma.h +1 -0
index e6e2691..7e22681 100644
@@ -135,6 +135,7 @@ struct svc_rdma_recv_ctxt {
 	u32			rc_byte_len;
 	unsigned int		rc_page_count;
 	unsigned int		rc_hdr_count;
+	u32			rc_inv_rkey;
 	struct page		*rc_pages[RPCSVC_MAXPAGES];
 };
 
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +63 -0

75 lines not on this page · raw message

net/sunrpc/xprtrdma/svc_rdma_sendto.c +13 -40

91 lines not on this page · raw message