Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

svcrdma: Reduce size of sge array in struct svc_rdma_op_ctxt

The sge array in struct svc_rdma_op_ctxt is no longer used for
sending RDMA Write WRs. It need only accommodate the construction of
Send and Receive WRs. The maximum inline size is the largest payload
it needs to handle now.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

authored by

Chuck Lever and committed by
J. Bruce Fields
ded8d196 f5821c76

+10 -5
+7 -2
include/linux/sunrpc/svc_rdma.h
··· 48 48 #include <rdma/rdma_cm.h> 49 49 #define SVCRDMA_DEBUG 50 50 51 + /* Default and maximum inline threshold sizes */ 52 + enum { 53 + RPCRDMA_DEF_INLINE_THRESH = 4096, 54 + RPCRDMA_MAX_INLINE_THRESH = 65536 55 + }; 56 + 51 57 /* RPC/RDMA parameters and stats */ 52 58 extern unsigned int svcrdma_ord; 53 59 extern unsigned int svcrdma_max_requests; ··· 92 86 int count; 93 87 unsigned int mapped_sges; 94 88 struct ib_send_wr send_wr; 95 - struct ib_sge sge[RPCSVC_MAXPAGES]; 89 + struct ib_sge sge[1 + RPCRDMA_MAX_INLINE_THRESH / PAGE_SIZE]; 96 90 struct page *pages[RPCSVC_MAXPAGES]; 97 91 }; 98 92 ··· 192 186 * page size of 4k, or 32k * 2 ops / 4k = 16 outstanding RDMA_READ. */ 193 187 #define RPCRDMA_ORD (64/4) 194 188 #define RPCRDMA_MAX_REQUESTS 32 195 - #define RPCRDMA_MAX_REQ_SIZE 4096 196 189 197 190 /* Typical ULP usage of BC requests is NFSv4.1 backchannel. Our 198 191 * current NFSv4.1 implementation supports one backchannel slot.
+3 -3
net/sunrpc/xprtrdma/svc_rdma.c
··· 58 58 unsigned int svcrdma_max_bc_requests = RPCRDMA_MAX_BC_REQUESTS; 59 59 static unsigned int min_max_requests = 4; 60 60 static unsigned int max_max_requests = 16384; 61 - unsigned int svcrdma_max_req_size = RPCRDMA_MAX_REQ_SIZE; 62 - static unsigned int min_max_inline = 4096; 63 - static unsigned int max_max_inline = 65536; 61 + unsigned int svcrdma_max_req_size = RPCRDMA_DEF_INLINE_THRESH; 62 + static unsigned int min_max_inline = RPCRDMA_DEF_INLINE_THRESH; 63 + static unsigned int max_max_inline = RPCRDMA_MAX_INLINE_THRESH; 64 64 65 65 atomic_t rdma_stat_recv; 66 66 atomic_t rdma_stat_read;