staging/rdma/hfi1: Verbs Mem affinity support
authorMitko Haralanov <mitko.haralanov@intel.com>
Wed, 3 Feb 2016 22:33:58 +0000 (14:33 -0800)
committerDoug Ledford <dledford@redhat.com>
Fri, 11 Mar 2016 01:37:52 +0000 (20:37 -0500)
Change verbs memory allocations to the device numa node.  This keeps memory
close to the device for optimal performance.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/staging/rdma/hfi1/init.c
drivers/staging/rdma/hfi1/qp.c

index 98b3fc1456601a76809b673f21ea33ec13be5599..629e92aa4f0a9d42648bf95a358732134d3bfcd4 100644 (file)
@@ -134,7 +134,8 @@ int hfi1_create_ctxts(struct hfi1_devdata *dd)
        /* Control context has to be always 0 */
        BUILD_BUG_ON(HFI1_CTRL_CTXT != 0);
 
-       dd->rcd = kcalloc(dd->num_rcv_contexts, sizeof(*dd->rcd), GFP_KERNEL);
+       dd->rcd = kzalloc_node(dd->num_rcv_contexts * sizeof(*dd->rcd),
+                              GFP_KERNEL, dd->node);
        if (!dd->rcd)
                goto nomem;
 
index 05a9619752aeefd64f935fa26f3788681c3b86cb..b78c8eadcd95e3f33367c6561ef394fafde082e0 100644 (file)
@@ -596,13 +596,13 @@ void *qp_priv_alloc(struct rvt_dev_info *rdi, struct rvt_qp *qp,
 {
        struct hfi1_qp_priv *priv;
 
-       priv = kzalloc(sizeof(*priv), gfp);
+       priv = kzalloc_node(sizeof(*priv), gfp, rdi->dparms.node);
        if (!priv)
                return ERR_PTR(-ENOMEM);
 
        priv->owner = qp;
 
-       priv->s_hdr = kzalloc(sizeof(*priv->s_hdr), gfp);
+       priv->s_hdr = kzalloc_node(sizeof(*priv->s_hdr), gfp, rdi->dparms.node);
        if (!priv->s_hdr) {
                kfree(priv);
                return ERR_PTR(-ENOMEM);