Commit ac3c32bb authored by Chuck Lever's avatar Chuck Lever

svcrdma: Clean up allocation of svc_rdma_rw_ctxt

The physical device's favored NUMA node ID is available when
allocating a rw_ctxt. Use that value instead of relying on the
assumption that the memory allocation happens to be running on a
node close to the device.
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent ed51b426
...@@ -62,8 +62,8 @@ svc_rdma_get_rw_ctxt(struct svcxprt_rdma *rdma, unsigned int sges) ...@@ -62,8 +62,8 @@ svc_rdma_get_rw_ctxt(struct svcxprt_rdma *rdma, unsigned int sges)
if (node) { if (node) {
ctxt = llist_entry(node, struct svc_rdma_rw_ctxt, rw_node); ctxt = llist_entry(node, struct svc_rdma_rw_ctxt, rw_node);
} else { } else {
ctxt = kmalloc(struct_size(ctxt, rw_first_sgl, SG_CHUNK_SIZE), ctxt = kmalloc_node(struct_size(ctxt, rw_first_sgl, SG_CHUNK_SIZE),
GFP_KERNEL); GFP_KERNEL, ibdev_to_node(rdma->sc_cm_id->device));
if (!ctxt) if (!ctxt)
goto out_noctx; goto out_noctx;
...@@ -234,7 +234,8 @@ svc_rdma_write_info_alloc(struct svcxprt_rdma *rdma, ...@@ -234,7 +234,8 @@ svc_rdma_write_info_alloc(struct svcxprt_rdma *rdma,
{ {
struct svc_rdma_write_info *info; struct svc_rdma_write_info *info;
info = kmalloc(sizeof(*info), GFP_KERNEL); info = kmalloc_node(sizeof(*info), GFP_KERNEL,
ibdev_to_node(rdma->sc_cm_id->device));
if (!info) if (!info)
return info; return info;
...@@ -304,7 +305,8 @@ svc_rdma_read_info_alloc(struct svcxprt_rdma *rdma) ...@@ -304,7 +305,8 @@ svc_rdma_read_info_alloc(struct svcxprt_rdma *rdma)
{ {
struct svc_rdma_read_info *info; struct svc_rdma_read_info *info;
info = kmalloc(sizeof(*info), GFP_KERNEL); info = kmalloc_node(sizeof(*info), GFP_KERNEL,
ibdev_to_node(rdma->sc_cm_id->device));
if (!info) if (!info)
return info; return info;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment