Skip to contentSkip to conversation

RDMA: Increasing RPCRDMA_MAX_DATA_SEGS

PATCH In review Steve Dickson 4 participants 6 messages Jul 21, 2011 – Jul 25, 2011

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

PATCH 1/1 RDMA: Increasing RPCRDMA_MAX_DATA_SEGS

Our performance team has noticed that increasing RPCRDMA_MAX_DATA_SEGS from 8 to 64 significantly increases throughput when using the RDMA transport.

---
 net/sunrpc/xprtrdma/xprt_rdma.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sunrpc/xprtrdma/xprt_rdma.h +1 -1
index cae761a..5d1cfe5 100644
@@ -109,7 +109,7 @@ struct rpcrdma_ep {
  */
 
 /* temporary static scatter/gather max */
-#define RPCRDMA_MAX_DATA_SEGS	(8)	/* max scatter/gather */
+#define RPCRDMA_MAX_DATA_SEGS	(64)	/* max scatter/gather */
 #define RPCRDMA_MAX_SEGS 	(RPCRDMA_MAX_DATA_SEGS + 2) /* head+tail = 2 */
 #define MAX_RPCRDMAHDR	(\
 	/* max supported RPC/RDMA header */ \
Signature · 1 line
1.7.6
#1 lore raw
Quoted 3 lines · Steve Dickson

Our performance team has noticed that increasing RPCRDMA_MAX_DATA_SEGS from 8 to 64 significantly increases throughput when using the RDMA transport.

The main risk that I can see being that we have on the stack in two places:

	rpcrdma_register_fmr_external(struct rpcrdma_mr_seg *seg, ...
	{
		...
		u64 physaddrs[RPCRDMA_MAX_DATA_SEGS];

	rpcrdma_register_default_external(struct rpcrdma_mr_seg *seg, ...
	{
		...
		struct ib_phys_buf ipb[RPCRDMA_MAX_DATA_SEGS]; 

Where ip_phys_buf is 16 bytes.

So that's 512 bytes in the first case, 1024 in the second. This is called from rpciod--what are our rules about allocating memory from rpciod?

--b.

Quoted 26 lines
---
 net/sunrpc/xprtrdma/xprt_rdma.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sunrpc/xprtrdma/xprt_rdma.h +1 -1
index cae761a..5d1cfe5 100644
@@ -109,7 +109,7 @@ struct rpcrdma_ep {
  */
 
 /* temporary static scatter/gather max */
-#define RPCRDMA_MAX_DATA_SEGS	(8)	/* max scatter/gather */
+#define RPCRDMA_MAX_DATA_SEGS	(64)	/* max scatter/gather */
 #define RPCRDMA_MAX_SEGS 	(RPCRDMA_MAX_DATA_SEGS + 2) /* head+tail = 2 */
 #define MAX_RPCRDMAHDR	(\
 	/* max supported RPC/RDMA header */ \
Signature · 6 lines
1.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
Quoted 18 lines · J. Bruce Fields
Quoted 3 lines · Steve Dickson

Our performance team has noticed that increasing RPCRDMA_MAX_DATA_SEGS from 8 to 64 significantly increases throughput when using the RDMA transport.

The main risk that I can see being that we have on the stack in two places:

	rpcrdma_register_fmr_external(struct rpcrdma_mr_seg *seg, ...
	{
		...
		u64 physaddrs[RPCRDMA_MAX_DATA_SEGS];

	rpcrdma_register_default_external(struct rpcrdma_mr_seg *seg, ...
	{
		...
		struct ib_phys_buf ipb[RPCRDMA_MAX_DATA_SEGS]; 
Quoted 5 lines

Where ip_phys_buf is 16 bytes.

So that's 512 bytes in the first case, 1024 in the second. This is called from rpciod--what are our rules about allocating memory from rpciod?

Is that allocated on the stack? We should always try to avoid 1024-byte allocations on the stack, since that eats up a full 1/8th (or 1/4 in the case of 4k stacks) of the total stack space.

If, OTOH, that memory is being allocated dynamically, then the rule is "don't let rpciod sleep".

Cheers
Trond

Signature · 6 lines
Trond Myklebust
Linux NFS client maintainer

NetApp
[email protected]
www.netapp.com
#3 lore raw
Quoted 21 lines · Trond Myklebust
Quoted 20 lines · J. Bruce Fields
Quoted 3 lines · Steve Dickson

Our performance team has noticed that increasing RPCRDMA_MAX_DATA_SEGS from 8 to 64 significantly increases throughput when using the RDMA transport.

The main risk that I can see being that we have on the stack in two places:

	rpcrdma_register_fmr_external(struct rpcrdma_mr_seg *seg, ...
	{
		...
		u64 physaddrs[RPCRDMA_MAX_DATA_SEGS];

	rpcrdma_register_default_external(struct rpcrdma_mr_seg *seg, ...
	{
		...
		struct ib_phys_buf ipb[RPCRDMA_MAX_DATA_SEGS]; 

Where ip_phys_buf is 16 bytes.

Quoted 7 lines
Quoted 3 lines

So that's 512 bytes in the first case, 1024 in the second. This is called from rpciod--what are our rules about allocating memory from rpciod?

Is that allocated on the stack? We should always try to avoid 1024-byte allocations on the stack, since that eats up a full 1/8th (or 1/4 in the case of 4k stacks) of the total stack space.

Right, it's on the stack, so I was wondering what we should do instead....

Quoted 2 lines

If, OTOH, that memory is being allocated dynamically, then the rule is "don't let rpciod sleep".

OK, so, looking around, the buf_alloc methods might provide examples to follow for dynamic allocation here?

--b.

#4 lore raw
In reply to Steve Dickson

On Thu, 21 Jul 2011 13:49:02 -0400, Steve Dickson wrote:

steved> Our performance team has noticed that increasing steved> RPCRDMA_MAX_DATA_SEGS from 8 to 64 significantly steved> increases throughput when using the RDMA transport.

Did they try new client with old server and vice versa? Both read and write?

max

#5 lore raw

Sorry for the delayed response... I took a day off..

Quoted 8 lines · Max Matveev

On Thu, 21 Jul 2011 13:49:02 -0400, Steve Dickson wrote:

steved> Our performance team has noticed that increasing steved> RPCRDMA_MAX_DATA_SEGS from 8 to 64 significantly steved> increases throughput when using the RDMA transport.

Did they try new client with old server and vice versa? Both read and write?

I believe it was done on the server side, but I've cc-ed the person who did the testing....

steved.