Skip to contentSkip to conversation

svcrdma: Optimize the logic that selects the R_key to invalidate

PATCH New Chuck Lever 1 participant 1 message Dec 10, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

The RPC-over-RDMA version 1 remote invalidation extension requires the server to select the R_key to invalidate. Make two minor optimizations to the selection algorithm:

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.

---

Hi Bruce-

This is ready for your for-next branch.

Changes since v2:
- Rebased on v4.20-rc6
- Further clarify the patch description

 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