From: Jubin John Date: Thu, 19 May 2016 12:21:31 +0000 (-0700) Subject: IB/rdmavt: Use kzalloc_node X-Git-Tag: v4.7~232^2~2^2~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49961f8fe8264fa231fbdcc4ca52c6706fdb2577;p=platform%2Fkernel%2Flinux-amlogic.git IB/rdmavt: Use kzalloc_node Use kzalloc_node instead of kzalloc for rdmavt memory region segment allocation to optimize for performance on NUMA platforms. Reviewed-by: Dennis Dalessandro Signed-off-by: Jubin John Signed-off-by: Doug Ledford --- diff --git a/drivers/infiniband/sw/rdmavt/mr.c b/drivers/infiniband/sw/rdmavt/mr.c index 0ff765b..0f4d450 100644 --- a/drivers/infiniband/sw/rdmavt/mr.c +++ b/drivers/infiniband/sw/rdmavt/mr.c @@ -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;