IB/rdmavt: Use kzalloc_node
authorJubin John <jubin.john@intel.com>
Thu, 19 May 2016 12:21:31 +0000 (05:21 -0700)
committerDoug Ledford <dledford@redhat.com>
Thu, 26 May 2016 15:23:10 +0000 (11:23 -0400)
Use kzalloc_node instead of kzalloc for rdmavt memory region segment
allocation to optimize for performance on NUMA platforms.

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rdmavt/mr.c

index 0ff765bfd619070a54d50c67caa61b85893d220b..0f4d4500f45e25597322e00cd744c4d05cda9831 100644 (file)
@@ -124,11 +124,13 @@ static int rvt_init_mregion(struct rvt_mregion *mr, struct ib_pd *pd,
                            int count)
 {
        int m, i = 0;
+       struct rvt_dev_info *dev = ib_to_rvt(pd->device);
 
        mr->mapsz = 0;
        m = (count + RVT_SEGSZ - 1) / RVT_SEGSZ;
        for (; i < m; i++) {
-               mr->map[i] = kzalloc(sizeof(*mr->map[0]), GFP_KERNEL);
+               mr->map[i] = kzalloc_node(sizeof(*mr->map[0]), GFP_KERNEL,
+                                         dev->dparms.node);
                if (!mr->map[i]) {
                        rvt_deinit_mregion(mr);
                        return -ENOMEM;