diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-17 16:01:03 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-07-17 16:01:03 -0400 |
commit | 43cedbf0e8dfb9c5610eb7985d5f21263e313802 (patch) | |
tree | 7758630292b6a276a3db72e63803ddc02c0a4444 /net/sunrpc/xprtrdma | |
parent | f85ef69ce08bc2209858135328335f668ba35bdb (diff) |
SUNRPC: Ensure that we grab the XPRT_LOCK before calling xprt_alloc_slot
This throttles the allocation of new slots when the socket is busy
reconnecting and/or is out of buffer space.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprtrdma')
-rw-r--r-- | net/sunrpc/xprtrdma/transport.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index 0867070bb5ca..674a49224450 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c | |||
@@ -452,9 +452,8 @@ xprt_rdma_connect(struct rpc_task *task) | |||
452 | } | 452 | } |
453 | 453 | ||
454 | static int | 454 | static int |
455 | xprt_rdma_reserve_xprt(struct rpc_task *task) | 455 | xprt_rdma_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task) |
456 | { | 456 | { |
457 | struct rpc_xprt *xprt = task->tk_xprt; | ||
458 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); | 457 | struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt); |
459 | int credits = atomic_read(&r_xprt->rx_buf.rb_credits); | 458 | int credits = atomic_read(&r_xprt->rx_buf.rb_credits); |
460 | 459 | ||
@@ -466,7 +465,7 @@ xprt_rdma_reserve_xprt(struct rpc_task *task) | |||
466 | BUG_ON(r_xprt->rx_buf.rb_cwndscale <= 0); | 465 | BUG_ON(r_xprt->rx_buf.rb_cwndscale <= 0); |
467 | } | 466 | } |
468 | xprt->cwnd = credits * r_xprt->rx_buf.rb_cwndscale; | 467 | xprt->cwnd = credits * r_xprt->rx_buf.rb_cwndscale; |
469 | return xprt_reserve_xprt_cong(task); | 468 | return xprt_reserve_xprt_cong(xprt, task); |
470 | } | 469 | } |
471 | 470 | ||
472 | /* | 471 | /* |