summaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2016-01-07 14:49:20 -0500
committerDoug Ledford <dledford@redhat.com>2016-01-19 15:30:48 -0500
commit2fe81b239dbb00d0a2fd8858ac9dd4ef4a8841ee (patch)
tree82da79b378d1347b6810a7ff2ac1a0040b0c2ef4 /include/linux/sunrpc
parentcc886c9ff1607eda04062bdcec963e2f8e6a3eb1 (diff)
svcrdma: Improve allocation of struct svc_rdma_req_map
To ensure this allocation cannot fail and will not sleep, pre-allocate the req_map structures per-connection. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Acked-by: Bruce Fields <bfields@fieldses.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r--include/linux/sunrpc/svc_rdma.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h
index be2804b72cd8..05bf4febad44 100644
--- a/include/linux/sunrpc/svc_rdma.h
+++ b/include/linux/sunrpc/svc_rdma.h
@@ -113,6 +113,7 @@ struct svc_rdma_fastreg_mr {
113 struct list_head frmr_list; 113 struct list_head frmr_list;
114}; 114};
115struct svc_rdma_req_map { 115struct svc_rdma_req_map {
116 struct list_head free;
116 unsigned long count; 117 unsigned long count;
117 union { 118 union {
118 struct kvec sge[RPCSVC_MAXPAGES]; 119 struct kvec sge[RPCSVC_MAXPAGES];
@@ -145,6 +146,8 @@ struct svcxprt_rdma {
145 spinlock_t sc_ctxt_lock; 146 spinlock_t sc_ctxt_lock;
146 struct list_head sc_ctxts; 147 struct list_head sc_ctxts;
147 int sc_ctxt_used; 148 int sc_ctxt_used;
149 spinlock_t sc_map_lock;
150 struct list_head sc_maps;
148 151
149 struct list_head sc_rq_dto_q; 152 struct list_head sc_rq_dto_q;
150 spinlock_t sc_rq_dto_lock; 153 spinlock_t sc_rq_dto_lock;
@@ -223,8 +226,9 @@ extern int svc_rdma_create_listen(struct svc_serv *, int, struct sockaddr *);
223extern struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *); 226extern struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *);
224extern void svc_rdma_put_context(struct svc_rdma_op_ctxt *, int); 227extern void svc_rdma_put_context(struct svc_rdma_op_ctxt *, int);
225extern void svc_rdma_unmap_dma(struct svc_rdma_op_ctxt *ctxt); 228extern void svc_rdma_unmap_dma(struct svc_rdma_op_ctxt *ctxt);
226extern struct svc_rdma_req_map *svc_rdma_get_req_map(void); 229extern struct svc_rdma_req_map *svc_rdma_get_req_map(struct svcxprt_rdma *);
227extern void svc_rdma_put_req_map(struct svc_rdma_req_map *); 230extern void svc_rdma_put_req_map(struct svcxprt_rdma *,
231 struct svc_rdma_req_map *);
228extern struct svc_rdma_fastreg_mr *svc_rdma_get_frmr(struct svcxprt_rdma *); 232extern struct svc_rdma_fastreg_mr *svc_rdma_get_frmr(struct svcxprt_rdma *);
229extern void svc_rdma_put_frmr(struct svcxprt_rdma *, 233extern void svc_rdma_put_frmr(struct svcxprt_rdma *,
230 struct svc_rdma_fastreg_mr *); 234 struct svc_rdma_fastreg_mr *);