]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xprtrdma: Replace send and receive arrays
authorChuck Lever <chuck.lever@oracle.com>
Tue, 21 Apr 2015 01:19:12 +0000 (21:19 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 31 Aug 2015 20:46:00 +0000 (14:46 -0600)
commitbc76e0116e208fd5a12364659af4b5253dbb24bd
treea9b1d549f887cadd9898ccdb23d27dc6791d118f
parent1a269eda4de0d912ca8410e8fae10830a170790c
xprtrdma: Replace send and receive arrays

[ Proposed for upstream v4.4 ]

The rb_send_bufs and rb_recv_bufs arrays are used to implement a
pair of stacks for keeping track of free rpcrdma_req and rpcrdma_rep
structs. Replace those arrays with free lists.

To allow more than 512 RPCs in-flight at once, each of these arrays
would be larger than a page (assuming 8-byte addresses and 4KB
pages). Allowing up to 64K in-flight RPCs (as TCP now does), each
buffer array would have to be 128 pages. That's an order-6
allocation. (Not that we're going there.)

A list is easier to expand dynamically. Instead of allocating a
larger array of pointers and copying the existing pointers to the
new array, simply append more buffers to each list.

This also makes it simpler to manage receive buffers that might
catch backwards-direction calls, or to post receive buffers in
bulk to amortize the overhead of ib_post_recv.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/xprtrdma/verbs.c
net/sunrpc/xprtrdma/xprt_rdma.h