Re: [PATCH] infiniband/hw/hfi1/tid_rdma: use kmalloc_array_node()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



在 2024/7/25 9:17, flyingpenghao@xxxxxxxxx 写道:
From: Peng Hao <flyingpeng@xxxxxxxxxxx>

kmalloc_array_node() is a NUMA-aware version of kmalloc_array that
has overflow checking and can be used as a replacement for kmalloc_node.

Signed-off-by: Peng Hao <flyingpeng@xxxxxxxxxxx>
---
  drivers/infiniband/hw/hfi1/tid_rdma.c | 2 +-

drivers/infiniband/sw/rdmavt/mmap.c:124:

ip = kmalloc_node(sizeof(*ip), GFP_KERNEL, rdi->dparms.node);

In the above file, not sure if this kmalloc_node needs to be replaced with kmalloc_array_node or not.

Zhu Yanjun

  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/hfi1/tid_rdma.c b/drivers/infiniband/hw/hfi1/tid_rdma.c
index c465966a1d9c..6b1921f6280b 100644
--- a/drivers/infiniband/hw/hfi1/tid_rdma.c
+++ b/drivers/infiniband/hw/hfi1/tid_rdma.c
@@ -1636,7 +1636,7 @@ static int hfi1_kern_exp_rcv_alloc_flows(struct tid_rdma_request *req,
if (likely(req->flows))
  		return 0;
-	flows = kmalloc_node(MAX_FLOWS * sizeof(*flows), gfp,
+	flows = kmalloc_array_node(MAX_FLOWS, sizeof(*flows), gfp,
  			     req->rcd->numa_id);
  	if (!flows)
  		return -ENOMEM;





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux