All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boaz Harrosh <bharrosh@panasas.com>
To: Steve Dickson <steved@redhat.com>
Cc: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] RDMA: RPCRDMA_MAX_DATA_SEGS cause i686 stack to blow.
Date: Thu, 3 Nov 2011 12:16:15 -0700	[thread overview]
Message-ID: <4EB2E87F.3060202@panasas.com> (raw)
In-Reply-To: <1320346359-1515-1-git-send-email-steved@redhat.com>

On 11/03/2011 11:52 AM, Steve Dickson wrote:
> Commit 2773395b3 increased RPCRDMA_MAX_DATA_SEGS from 8
> to 64 which significantly increases throughput with the
> RDMA transport.
> 
> Unfortunately making RPCRDMA_MAX_DATA_SEGS that large blows
> the stack on i686 builds during compilation. So the
> RPCRDMA_MAX_PHYSREG_DATA_SEGS is used to allocated data on
> the stack.
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
>  net/sunrpc/xprtrdma/verbs.c     |    6 +++---
>  net/sunrpc/xprtrdma/xprt_rdma.h |    1 +
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
> index 28236ba..68ba0fb 100644
> --- a/net/sunrpc/xprtrdma/verbs.c
> +++ b/net/sunrpc/xprtrdma/verbs.c
> @@ -1729,11 +1729,11 @@ rpcrdma_register_default_external(struct rpcrdma_mr_seg *seg,
>  	int mem_priv = (writing ? IB_ACCESS_REMOTE_WRITE :
>  				  IB_ACCESS_REMOTE_READ);
>  	struct rpcrdma_mr_seg *seg1 = seg;
> -	struct ib_phys_buf ipb[RPCRDMA_MAX_DATA_SEGS];
> +	struct ib_phys_buf ipb[RPCRDMA_MAX_PHYSREG_DATA_SEGS];

Can't you just allocate this buffer on heap? Any size of a big array
on the stack is a bad idea. And it does help performance as reported
by original commit

Boaz
>  	int len, i, rc = 0;
>  
> -	if (*nsegs > RPCRDMA_MAX_DATA_SEGS)
> -		*nsegs = RPCRDMA_MAX_DATA_SEGS;
> +	if (*nsegs > RPCRDMA_MAX_PHYSREG_DATA_SEGS)
> +		*nsegs = RPCRDMA_MAX_PHYSREG_DATA_SEGS;
>  	for (len = 0, i = 0; i < *nsegs;) {
>  		rpcrdma_map_one(ia, seg, writing);
>  		ipb[i].addr = seg->mr_dma;
> diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h
> index 08c5d5a..8d588f2 100644
> --- a/net/sunrpc/xprtrdma/xprt_rdma.h
> +++ b/net/sunrpc/xprtrdma/xprt_rdma.h
> @@ -110,6 +110,7 @@ struct rpcrdma_ep {
>  
>  /* temporary static scatter/gather max */
>  #define RPCRDMA_MAX_DATA_SEGS	(64)	/* max scatter/gather */
> +#define RPCRDMA_MAX_PHYSREG_DATA_SEGS	(16)
>  #define RPCRDMA_MAX_SEGS 	(RPCRDMA_MAX_DATA_SEGS + 2) /* head+tail = 2 */
>  #define MAX_RPCRDMAHDR	(\
>  	/* max supported RPC/RDMA header */ \


  parent reply	other threads:[~2011-11-03 19:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-03 18:52 [PATCH 1/2] RDMA: RPCRDMA_MAX_DATA_SEGS cause i686 stack to blow Steve Dickson
2011-11-03 18:52 ` [PATCH 2/2] RDMA: Remove defunct memory window and FMR registrations Steve Dickson
2011-11-03 19:16 ` Boaz Harrosh [this message]
2011-11-04  8:03 ` [PATCH 1/2] RDMA: RPCRDMA_MAX_DATA_SEGS cause i686 stack to blow Max Matveev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EB2E87F.3060202@panasas.com \
    --to=bharrosh@panasas.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.