linux/net/sunrpc/xprtrdma
Chuck Lever 65866f8259 xprtrdma: Reduce the number of hardway buffer allocations
While marshaling an RPC/RDMA request, the inline_{rsize,wsize}
settings determine whether an inline request is used, or whether
read or write chunks lists are built. The current default value of
these settings is 1024. Any RPC request smaller than 1024 bytes is
sent to the NFS server completely inline.

rpcrdma_buffer_create() allocates and pre-registers a set of RPC
buffers for each transport instance, also based on the inline rsize
and wsize settings.

RPC/RDMA requests and replies are built in these buffers. However,
if an RPC/RDMA request is expected to be larger than 1024, a buffer
has to be allocated and registered for that RPC, and deregistered
and released when the RPC is complete. This is known has a
"hardway allocation."

Since the introduction of NFSv4, the size of RPC requests has become
larger, and hardway allocations are thus more frequent. Hardway
allocations are significant overhead, and they waste the existing
RPC buffers pre-allocated by rpcrdma_buffer_create().

We'd like fewer hardway allocations.

Increasing the size of the pre-registered buffers is the most direct
way to do this. However, a blanket increase of the inline thresholds
has interoperability consequences.

On my 64-bit system, rpcrdma_buffer_create() requests roughly 7000
bytes for each RPC request buffer, using kmalloc(). Due to internal
fragmentation, this wastes nearly 1200 bytes because kmalloc()
already returns an 8192-byte piece of memory for a 7000-byte
allocation request, though the extra space remains unused.

So let's round up the size of the pre-allocated buffers, and make
use of the unused space in the kmalloc'd memory.

This change reduces the amount of hardway allocated memory for an
NFSv4 general connectathon run from 1322092 to 9472 bytes (99%).

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Tested-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
2014-06-04 08:56:46 -04:00
..
Makefile xprtrdma: add separate Kconfig options for NFSoRDMA client and server support 2014-03-28 18:02:12 -04:00
rpc_rdma.c xprtrdma: Simplify rpcrdma_deregister_external() synopsis 2014-06-04 08:56:40 -04:00
svc_rdma.c net: Convert uses of typedef ctl_table to struct ctl_table 2013-06-13 02:36:09 -07:00
svc_rdma_marshal.c svcrdma: underflow issue in decode_write_list() 2013-07-15 11:46:23 -04:00
svc_rdma_recvfrom.c Fix regression in NFSRDMA server 2014-03-28 18:02:11 -04:00
svc_rdma_sendto.c svcrdma: fix offset calculation for non-page aligned sge entries 2014-03-28 18:02:13 -04:00
svc_rdma_transport.c svcrdma: fix printk when memory allocation fails 2014-03-27 16:31:56 -04:00
transport.c xprtrdma: Make rpcrdma_ep_destroy() return void 2014-06-04 08:56:41 -04:00
verbs.c xprtrdma: Reduce the number of hardway buffer allocations 2014-06-04 08:56:46 -04:00
xprt_rdma.h xprtrdma: Limit work done by completion handler 2014-06-04 08:56:45 -04:00