Skip to contentSkip to conversation

RDMA/irdma: Use kvzalloc for paged memory DMA address array

PATCH In review Carlos Bilbao 4 participants 6 messages Jan 21 – Jan 28

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/irdma: Use kvzalloc for paged memory DMA address array

Allocate array chunk->dmainfo.dmaaddrs using kvzalloc() to allow the allocation to fall back to vmalloc when contiguous memory is unavailable (instead of failing and logging page allocation warnings).

---
 drivers/infiniband/hw/irdma/utils.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
(quoted diff) +0 -0

b/drivers/infiniband/hw/irdma/utils.c
index 0422787592d8..59ef9856fd25 100644

drivers/infiniband/hw/irdma/utils.c +0 -0
@@ -2257,7 +2257,7 @@ void irdma_pble_free_paged_mem(struct irdma_chunk

*chunk)

                                 chunk->pg_cnt);

done:
- kfree(chunk->dmainfo.dmaaddrs);

+       kvfree(chunk->dmainfo.dmaaddrs);
        chunk->dmainfo.dmaaddrs = NULL;
        vfree(chunk->vaddr);
        chunk->vaddr = NULL;
@@ -2274,7 +2274,7 @@ int irdma_pble_get_paged_mem(struct irdma_chunk
*chunk, u32 pg_cnt)
        u32 size;
        void *va;

- chunk->dmainfo.dmaaddrs = kzalloc(pg_cnt << 3, GFP_KERNEL);

+       chunk->dmainfo.dmaaddrs = kvzalloc(pg_cnt << 3, GFP_KERNEL);
        if (!chunk->dmainfo.dmaaddrs)
                return -ENOMEM;

@@ -2295,7 +2295,7 @@ int irdma_pble_get_paged_mem(struct irdma_chunk *chunk, u32 pg_cnt)

        return 0;
 err:
-       kfree(chunk->dmainfo.dmaaddrs);
+       kvfree(chunk->dmainfo.dmaaddrs);
        chunk->dmainfo.dmaaddrs = NULL;

        return -ENOMEM;

-- 2.50.1 (Apple Git-155)

#1 lore raw

Looks like Mustafa is no longer at Intel [1]. Does anyone know how to reach them, or Shiraz? Their email addresses appear to be bouncing as well.

Maybe you do, Andrew?

[1] https://www.phoronix.com/news/Intel-More-Orphans-Maintainers

Quoted 47 lines · Carlos Bilbao

Allocate array chunk->dmainfo.dmaaddrs using kvzalloc() to allow the allocation to fall back to vmalloc when contiguous memory is unavailable (instead of failing and logging page allocation warnings).

---
 drivers/infiniband/hw/irdma/utils.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/hw/irdma/utils.c +1 -1
index 0422787592d8..59ef9856fd25 100644
@@ -2257,7 +2257,7 @@ void irdma_pble_free_paged_mem(struct irdma_chunk
 *chunk)
                                 chunk->pg_cnt);
 
 done:
-       kfree(chunk->dmainfo.dmaaddrs);
+       kvfree(chunk->dmainfo.dmaaddrs);
        chunk->dmainfo.dmaaddrs = NULL;
        vfree(chunk->vaddr);
        chunk->vaddr = NULL;
drivers/infiniband/hw/irdma/utils.c +2 -2
@@ -2274,7 +2274,7 @@ int irdma_pble_get_paged_mem(struct irdma_chunk
 *chunk, u32 pg_cnt)
        u32 size;
        void *va;
 
-       chunk->dmainfo.dmaaddrs = kzalloc(pg_cnt << 3, GFP_KERNEL);
+       chunk->dmainfo.dmaaddrs = kvzalloc(pg_cnt << 3, GFP_KERNEL);
        if (!chunk->dmainfo.dmaaddrs)
                return -ENOMEM;
@@ -2295,7 +2295,7 @@ int irdma_pble_get_paged_mem(struct irdma_chunk
 *chunk, u32 pg_cnt)
 
        return 0;
 err:
-       kfree(chunk->dmainfo.dmaaddrs);
+       kvfree(chunk->dmainfo.dmaaddrs);
        chunk->dmainfo.dmaaddrs = NULL;
 
        return -ENOMEM;

-- 2.50.1 (Apple Git-155)

maintainer Acked-by on v1 1/1
#2 lore raw
In reply to Carlos Bilbao
Quoted 12 lines

-----Original Message-----
From: Carlos Bilbao <[email protected]>
Sent: Wednesday, January 21, 2026 12:55 PM
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH] RDMA/irdma: Use kvzalloc for paged memory DMA address array

Quoted 5 lines

Allocate array chunk->dmainfo.dmaaddrs using kvzalloc() to allow the allocation to fall back to vmalloc when contiguous memory is unavailable (instead of failing and logging page allocation warnings).

Quoted 45 lines
---
 drivers/infiniband/hw/irdma/utils.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/hw/irdma/utils.c +0 -0
index 0422787592d8..59ef9856fd25 100644
@@ -2257,7 +2257,7 @@ void irdma_pble_free_paged_mem(struct

irdma_chunk
*chunk)

                                 chunk->pg_cnt);

done:

drivers/infiniband/hw/irdma/utils.c +1 -1
-       kfree(chunk->dmainfo.dmaaddrs);
+       kvfree(chunk->dmainfo.dmaaddrs);
        chunk->dmainfo.dmaaddrs = NULL;
        vfree(chunk->vaddr);
        chunk->vaddr = NULL;
@@ -2274,7 +2274,7 @@ int irdma_pble_get_paged_mem(struct

irdma_chunk
*chunk, u32 pg_cnt)

        u32 size;
        void *va;
drivers/infiniband/hw/irdma/utils.c +1 -1
-       chunk->dmainfo.dmaaddrs = kzalloc(pg_cnt << 3, GFP_KERNEL);
+       chunk->dmainfo.dmaaddrs = kvzalloc(pg_cnt << 3, GFP_KERNEL);
        if (!chunk->dmainfo.dmaaddrs)
                return -ENOMEM;
@@ -2295,7 +2295,7 @@ int irdma_pble_get_paged_mem(struct

irdma_chunk
*chunk, u32 pg_cnt)

        return 0;

err:

drivers/infiniband/hw/irdma/utils.c +1 -2
-       kfree(chunk->dmainfo.dmaaddrs);
+       kvfree(chunk->dmainfo.dmaaddrs);
        chunk->dmainfo.dmaaddrs = NULL;
 
        return -ENOMEM;
-- 2.50.1 (Apple Git-155)
#3 lore raw
In reply to Carlos Bilbao
Quoted 8 lines · Carlos Bilbao

Allocate array chunk->dmainfo.dmaaddrs using kvzalloc() to allow the allocation to fall back to vmalloc when contiguous memory is unavailable (instead of failing and logging page allocation warnings).

---
 drivers/infiniband/hw/irdma/utils.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

This patch doesn't apply to rdma/for-next.

Thanks

#4 lore raw

PATCH v2 1/1 RDMA/irdma: Use kvzalloc for paged memory DMA address array

From: Carlos Bilbao <[email protected]>

Allocate array chunk->dmainfo.dmaaddrs using kvzalloc() to allow the allocation to fall back to vmalloc when contiguous memory is unavailable (instead of failing and logging page allocation warnings).

---
 drivers/infiniband/hw/irdma/utils.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/hw/irdma/utils.c +3 -3
index 13d7499131d4..6aac6d314564 100644
@@ -2239,7 +2239,7 @@ void irdma_pble_free_paged_mem(struct irdma_chunk *chunk)
 				 chunk->pg_cnt);
 
 done:
-	kfree(chunk->dmainfo.dmaaddrs);
+	kvfree(chunk->dmainfo.dmaaddrs);
 	chunk->dmainfo.dmaaddrs = NULL;
 	vfree(chunk->vaddr);
 	chunk->vaddr = NULL;
@@ -2256,7 +2256,7 @@ int irdma_pble_get_paged_mem(struct irdma_chunk *chunk, u32 pg_cnt)
 	u32 size;
 	void *va;
 
-	chunk->dmainfo.dmaaddrs = kzalloc(pg_cnt << 3, GFP_KERNEL);
+	chunk->dmainfo.dmaaddrs = kvzalloc(pg_cnt << 3, GFP_KERNEL);
 	if (!chunk->dmainfo.dmaaddrs)
 		return -ENOMEM;
 
@@ -2277,7 +2277,7 @@ int irdma_pble_get_paged_mem(struct irdma_chunk *chunk, u32 pg_cnt)
 
 	return 0;
 err:
-	kfree(chunk->dmainfo.dmaaddrs);
+	kvfree(chunk->dmainfo.dmaaddrs);
 	chunk->dmainfo.dmaaddrs = NULL;
 
 	return -ENOMEM;
Signature · 1 line
2.43.0
#5 lore raw
Quoted 5 lines · On Tue, 27 Jan 2026 17:44:46 -0800, [email protected] wrote:

Allocate array chunk->dmainfo.dmaaddrs using kvzalloc() to allow the allocation to fall back to vmalloc when contiguous memory is unavailable (instead of failing and logging page allocation warnings).

Applied, thanks!

[1/1] RDMA/irdma: Use kvzalloc for paged memory DMA address array

      https://git.kernel.org/rdma/rdma/c/959d2c356e32ab

Best regards,

Signature · 1 line
Leon Romanovsky <[email protected]>