svcrdma: Improve allocation of struct svc_rdma_op_ctxt
authorChuck Lever <chuck.lever@oracle.com>
Thu, 7 Jan 2016 19:49:12 +0000 (14:49 -0500)
committerDoug Ledford <dledford@redhat.com>
Tue, 19 Jan 2016 20:30:48 +0000 (15:30 -0500)
commitcc886c9ff1607eda04062bdcec963e2f8e6a3eb1
tree26cb6dea78b0a3fbdcab65159a180de1fbba7aec
parentced4ac0c4f7819d586b559a2ed7244e4f78ac3d0
svcrdma: Improve allocation of struct svc_rdma_op_ctxt

When the maximum payload size of NFS READ and WRITE was increased
by commit cc9a903d915c ("svcrdma: Change maximum server payload back
to RPCSVC_MAXPAYLOAD"), the size of struct svc_rdma_op_ctxt
increased to over 6KB (on x86_64). That makes allocating one of
these from a kmem_cache more likely to fail in situations when
system memory is exhausted.

Since I'm about to add a caller where this allocation must always
work _and_ it cannot sleep, pre-allocate ctxts for each connection.

Another motivation for this change is that NFSv4.x servers are
required by specification not to drop NFS requests. Pre-allocating
memory resources reduces the likelihood of a drop.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Acked-by: Bruce Fields <bfields@fieldses.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
include/linux/sunrpc/svc_rdma.h
net/sunrpc/xprtrdma/svc_rdma_transport.c