浏览代码

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 <dennis.dalessandro@intel.com>
Signed-off-by: Jubin John <jubin.john@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Jubin John 9 年之前
父节点
当前提交
49961f8fe8
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      drivers/infiniband/sw/rdmavt/mr.c

+ 3 - 1
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 count)
 {
 {
 	int m, i = 0;
 	int m, i = 0;
+	struct rvt_dev_info *dev = ib_to_rvt(pd->device);
 
 
 	mr->mapsz = 0;
 	mr->mapsz = 0;
 	m = (count + RVT_SEGSZ - 1) / RVT_SEGSZ;
 	m = (count + RVT_SEGSZ - 1) / RVT_SEGSZ;
 	for (; i < m; i++) {
 	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]) {
 		if (!mr->map[i]) {
 			rvt_deinit_mregion(mr);
 			rvt_deinit_mregion(mr);
 			return -ENOMEM;
 			return -ENOMEM;