SUNRPC: More fixes for backlog congestion
Subsystems (3)
[email protected]
maintainerPATCH 1/1 SUNRPC: More fixes for backlog congestion
From: Trond Myklebust <[email protected]>
Ensure that we fix the XPRT_CONGESTED starvation issue for RDMA as well as socket based transports.
Ensure we always initialise the request after waking up from the backlog list.
Fixes e877a88d1f06 ("SUNRPC in case of backlog, hand free slots directly to waiting task")
Signed-off-by Trond Myklebust <[email protected]>
--- include/linux/sunrpc/xprt.h | 2 ++ net/sunrpc/xprt.c | 58 ++++++++++++++++----------------- net/sunrpc/xprtrdma/transport.c | 6 ++-- 3 files changed, 32 insertions(+), 34 deletions(-)
include/linux/sunrpc/xprt.h +2 -0
@@ -368,6 +368,8 @@ struct rpc_xprt * xprt_alloc(struct net *net, size_t size,unsigned int num_prealloc, unsigned int max_req);void xprt_free (struct rpc_xprt *); +void xprt_add_backlog (struct rpc_xprt *xprt,struct rpc_task *task); +bool xprt_wake_up_backlog (struct rpc_xprt *xprt,struct rpc_rqst *req);static inline int xprt_enable_swap (struct rpc_xprt *xprt)
net/sunrpc/xprt.c +28 -30
110 lines not on this page · raw message
net/sunrpc/xprtrdma/transport.c +2 -4
@@ -520,9 +520,8 @@ xprt_rdma_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task)return ; out_sleep: -set_bit (XPRT_CONGESTED , &xprt->state); -rpc_sleep_on (&xprt->backlog, task,NULL ); task->tk_status = -EAGAIN ; +xprt_add_backlog (xprt, task); }/**
@@ -539,8 +538,7 @@ xprt_rdma_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *rqst)memset (rqst,0 ,sizeof (*rqst));rpcrdma_buffer_put (&r_xprt->rx_buf,rpcr_to_rdmar (rqst)); -if (unlikely (!rpc_wake_up_next (&xprt->backlog))) -clear_bit (XPRT_CONGESTED , &xprt->state); +xprt_wake_up_backlog (xprt, rqst); } static bool rpcrdma_check_regbuf(struct rpcrdma_xprt *r_xprt,
Signature · 1 line
2.31.1