* [PATCH v2 1/5] RDMA/umem: ib_umem_get(): use kmalloc() to allocate page array
2026-07-13 7:17 [PATCH v2 0/5] RDMA, IB: replace __get_free_pages() with kmalloc() Mike Rapoport (Microsoft)
@ 2026-07-13 7:17 ` Mike Rapoport (Microsoft)
2026-07-13 7:17 ` [PATCH v2 2/5] RDMA/mlx5: replace __get_free_page() with kmalloc() Mike Rapoport (Microsoft)
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-13 7:17 UTC (permalink / raw)
To: Jason Gunthorpe, Leon Romanovsky
Cc: Dennis Dalessandro, Mike Rapoport, linux-kernel, linux-mm,
linux-rdma
ib_umem_get() allocates an array of pointers to struct page for
pin_user_pages_fast() calls during memory registration.
This array can be allocated with kmalloc() as there's nothing special
about it to go directly to the page allocator.
kmalloc() provides a better API that does not require ugly casts and
kfree() does not need to know the size of the freed object.
Performance difference between kmalloc() and __get_free_pages() is not
measurable as both allocators take an object/page from a per-CPU list for
fast path allocations.
For the slow path the performance is anyway determined by the amount of
reclaim involved rather than by what allocator is used.
Replace use of __get_free_page() with kmalloc() and free_page() with
kfree().
Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
drivers/infiniband/core/umem.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
index 73498723a5d5..81f44dadfa52 100644
--- a/drivers/infiniband/core/umem.c
+++ b/drivers/infiniband/core/umem.c
@@ -209,7 +209,8 @@ static struct ib_umem *__ib_umem_get_va(struct ib_device *device,
mmgrab(mm);
- page_list = (struct page **) __get_free_page(GFP_KERNEL);
+ /* TODO: switch to "fast and as large as possible" allocation helper */
+ page_list = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!page_list) {
ret = -ENOMEM;
goto umem_kfree;
@@ -269,7 +270,7 @@ static struct ib_umem *__ib_umem_get_va(struct ib_device *device,
__ib_umem_release(device, umem, 0);
atomic64_sub(ib_umem_num_pages(umem), &mm->pinned_vm);
out:
- free_page((unsigned long) page_list);
+ kfree(page_list);
umem_kfree:
if (ret) {
mmdrop(umem->owning_mm);
--
2.53.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 2/5] RDMA/mlx5: replace __get_free_page() with kmalloc()
2026-07-13 7:17 [PATCH v2 0/5] RDMA, IB: replace __get_free_pages() with kmalloc() Mike Rapoport (Microsoft)
2026-07-13 7:17 ` [PATCH v2 1/5] RDMA/umem: ib_umem_get(): use kmalloc() to allocate page array Mike Rapoport (Microsoft)
@ 2026-07-13 7:17 ` Mike Rapoport (Microsoft)
2026-07-13 7:17 ` [PATCH v2 3/5] IB/mthca: mthca_reg_user_mr(): use kmalloc() to allocate addresses array Mike Rapoport (Microsoft)
` (4 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-13 7:17 UTC (permalink / raw)
To: Jason Gunthorpe, Leon Romanovsky
Cc: Dennis Dalessandro, Mike Rapoport, linux-kernel, linux-mm,
linux-rdma
mlx5_ib_mr_wqe_pfault_handler() allocates a scratch buffer for
parsing work queue entries during page fault handling.
This buffer can be allocated with kmalloc() as there's nothing special
about it to go directly to the page allocator.
kmalloc() provides a better API that does not require ugly casts and
kfree() does not need to know the size of the freed object.
Performance difference between kmalloc() and __get_free_pages() is not
measurable as both allocators take an object/page from a per-CPU list for
fast path allocations.
For the slow path the performance is anyway determined by the amount of
reclaim involved rather than by what allocator is used.
Replace use of __get_free_page() with kmalloc() and free_page() with
kfree().
Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
drivers/infiniband/hw/mlx5/odp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c
index 1badec9bf527..b8618610737a 100644
--- a/drivers/infiniband/hw/mlx5/odp.c
+++ b/drivers/infiniband/hw/mlx5/odp.c
@@ -37,6 +37,7 @@
#include <linux/hmm.h>
#include <linux/hmm-dma.h>
#include <linux/pci-p2pdma.h>
+#include <linux/slab.h>
#include "mlx5_ib.h"
#include "cmd.h"
@@ -1414,7 +1415,8 @@ static void mlx5_ib_mr_wqe_pfault_handler(struct mlx5_ib_dev *dev,
goto resolve_page_fault;
}
- wqe_start = (void *)__get_free_page(GFP_KERNEL);
+ /* TODO: switch to "fast and as large as possible" allocation helper */
+ wqe_start = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!wqe_start) {
mlx5_ib_err(dev, "Error allocating memory for IO page fault handling.\n");
goto resolve_page_fault;
@@ -1475,7 +1477,7 @@ static void mlx5_ib_mr_wqe_pfault_handler(struct mlx5_ib_dev *dev,
pfault->wqe.wq_num, resume_with_error,
pfault->type);
mlx5_core_res_put(res);
- free_page((unsigned long)wqe_start);
+ kfree(wqe_start);
}
static void mlx5_ib_mr_rdma_pfault_handler(struct mlx5_ib_dev *dev,
--
2.53.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 3/5] IB/mthca: mthca_reg_user_mr(): use kmalloc() to allocate addresses array
2026-07-13 7:17 [PATCH v2 0/5] RDMA, IB: replace __get_free_pages() with kmalloc() Mike Rapoport (Microsoft)
2026-07-13 7:17 ` [PATCH v2 1/5] RDMA/umem: ib_umem_get(): use kmalloc() to allocate page array Mike Rapoport (Microsoft)
2026-07-13 7:17 ` [PATCH v2 2/5] RDMA/mlx5: replace __get_free_page() with kmalloc() Mike Rapoport (Microsoft)
@ 2026-07-13 7:17 ` Mike Rapoport (Microsoft)
2026-07-13 7:17 ` [PATCH v2 4/5] IB/mthca: allocate mthca_array memory with kzalloc() Mike Rapoport (Microsoft)
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-13 7:17 UTC (permalink / raw)
To: Jason Gunthorpe, Leon Romanovsky
Cc: Dennis Dalessandro, Mike Rapoport, linux-kernel, linux-mm,
linux-rdma
mthca_reg_user_mr() allocates an array of DMA addresses during memory
registration.
This buffer can be allocated with kmalloc() as there's nothing special
about it to go directly to the page allocator.
kmalloc() provides a better API that does not require ugly casts and
kfree() does not need to know the size of the freed object.
Performance difference between kmalloc() and __get_free_pages() is not
measurable as both allocators take an object/page from a per-CPU list for
fast path allocations.
For the slow path the performance is anyway determined by the amount of
reclaim involved rather than by what allocator is used.
Replace use of __get_free_page() with kmalloc() and free_page() with
kfree().
Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
drivers/infiniband/hw/mthca/mthca_provider.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c
index f90f67afc8fa..9940165781e1 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.c
+++ b/drivers/infiniband/hw/mthca/mthca_provider.c
@@ -895,7 +895,8 @@ static struct ib_mr *mthca_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
goto err_umem;
}
- pages = (u64 *) __get_free_page(GFP_KERNEL);
+ /* TODO: switch to "fast and as large as possible" allocation helper */
+ pages = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (!pages) {
err = -ENOMEM;
goto err_mtt;
@@ -924,7 +925,7 @@ static struct ib_mr *mthca_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
if (i)
err = mthca_write_mtt(dev, mr->mtt, n, pages, i);
mtt_done:
- free_page((unsigned long) pages);
+ kfree(pages);
if (err)
goto err_mtt;
--
2.53.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 4/5] IB/mthca: allocate mthca_array memory with kzalloc()
2026-07-13 7:17 [PATCH v2 0/5] RDMA, IB: replace __get_free_pages() with kmalloc() Mike Rapoport (Microsoft)
` (2 preceding siblings ...)
2026-07-13 7:17 ` [PATCH v2 3/5] IB/mthca: mthca_reg_user_mr(): use kmalloc() to allocate addresses array Mike Rapoport (Microsoft)
@ 2026-07-13 7:17 ` Mike Rapoport (Microsoft)
2026-07-13 7:17 ` [PATCH v2 5/5] IB/rdmavt: use kzalloc() to allocate QPN-map pages Mike Rapoport (Microsoft)
` (2 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-13 7:17 UTC (permalink / raw)
To: Jason Gunthorpe, Leon Romanovsky
Cc: Dennis Dalessandro, Mike Rapoport, linux-kernel, linux-mm,
linux-rdma
mthca_array is essentially a sparse array of pointers and there is no
need to allocate its memory using page allocator.
kmalloc() provides a better API that does not require ugly casts and
kfree() does not need to know the size of the freed object.
Performance difference between kmalloc() and __get_free_pages() is not
measurable as both allocators take an object/page from a per-CPU list for
fast path allocations.
For the slow path the performance is anyway determined by the amount of
reclaim involved rather than by what allocator is used.
Replace use of get_zeroed_page() with kzalloc() and free_page() with
kfree().
Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
drivers/infiniband/hw/mthca/mthca_allocator.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/infiniband/hw/mthca/mthca_allocator.c b/drivers/infiniband/hw/mthca/mthca_allocator.c
index dedc301235a0..117a070e784e 100644
--- a/drivers/infiniband/hw/mthca/mthca_allocator.c
+++ b/drivers/infiniband/hw/mthca/mthca_allocator.c
@@ -126,7 +126,7 @@ int mthca_array_set(struct mthca_array *array, int index, void *value)
/* Allocate with GFP_ATOMIC because we'll be called with locks held. */
if (!array->page_list[p].page)
- array->page_list[p].page = (void **) get_zeroed_page(GFP_ATOMIC);
+ array->page_list[p].page = kzalloc(PAGE_SIZE, GFP_ATOMIC);
if (!array->page_list[p].page)
return -ENOMEM;
@@ -142,7 +142,7 @@ void mthca_array_clear(struct mthca_array *array, int index)
int p = (index * sizeof (void *)) >> PAGE_SHIFT;
if (--array->page_list[p].used == 0) {
- free_page((unsigned long) array->page_list[p].page);
+ kfree(array->page_list[p].page);
array->page_list[p].page = NULL;
} else
array->page_list[p].page[index & MTHCA_ARRAY_MASK] = NULL;
@@ -174,7 +174,7 @@ void mthca_array_cleanup(struct mthca_array *array, int nent)
int i;
for (i = 0; i < (nent * sizeof (void *) + PAGE_SIZE - 1) / PAGE_SIZE; ++i)
- free_page((unsigned long) array->page_list[i].page);
+ kfree(array->page_list[i].page);
kfree(array->page_list);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 5/5] IB/rdmavt: use kzalloc() to allocate QPN-map pages
2026-07-13 7:17 [PATCH v2 0/5] RDMA, IB: replace __get_free_pages() with kmalloc() Mike Rapoport (Microsoft)
` (3 preceding siblings ...)
2026-07-13 7:17 ` [PATCH v2 4/5] IB/mthca: allocate mthca_array memory with kzalloc() Mike Rapoport (Microsoft)
@ 2026-07-13 7:17 ` Mike Rapoport (Microsoft)
2026-07-14 12:24 ` [PATCH v2 0/5] RDMA, IB: replace __get_free_pages() with kmalloc() Leon Romanovsky
2026-07-14 12:26 ` Leon Romanovsky
6 siblings, 0 replies; 9+ messages in thread
From: Mike Rapoport (Microsoft) @ 2026-07-13 7:17 UTC (permalink / raw)
To: Jason Gunthorpe, Leon Romanovsky
Cc: Dennis Dalessandro, Mike Rapoport, linux-kernel, linux-mm,
linux-rdma
get_map_page() allocates bitmap pages using get_zeroed_page().
The bitmaps can be allocated with kmalloc() as there's nothing special
about them to go directly to the page allocator.
kmalloc() provides a better API that does not require ugly casts and
kfree() does not need to know the size of the freed object.
Performance difference between kmalloc() and __get_free_pages() is not
measurable as both allocators take an object/page from a per-CPU list for
fast path allocations.
For the slow path the performance is anyway determined by the amount of
reclaim involved rather than by what allocator is used.
Replace use of get_zeroed_page() with kzalloc() and free_page() with
kfree().
Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
---
drivers/infiniband/sw/rdmavt/qp.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/infiniband/sw/rdmavt/qp.c b/drivers/infiniband/sw/rdmavt/qp.c
index 70e7d08fdce6..c40cce69e945 100644
--- a/drivers/infiniband/sw/rdmavt/qp.c
+++ b/drivers/infiniband/sw/rdmavt/qp.c
@@ -263,7 +263,7 @@ static inline bool wss_exceeds_threshold(struct rvt_wss *wss)
static void get_map_page(struct rvt_qpn_table *qpt,
struct rvt_qpn_map *map)
{
- unsigned long page = get_zeroed_page(GFP_KERNEL);
+ void *page = kzalloc(PAGE_SIZE, GFP_KERNEL);
/*
* Free the page if someone raced with us installing it.
@@ -271,9 +271,9 @@ static void get_map_page(struct rvt_qpn_table *qpt,
spin_lock(&qpt->lock);
if (map->page)
- free_page(page);
+ kfree(page);
else
- map->page = (void *)page;
+ map->page = page;
spin_unlock(&qpt->lock);
}
@@ -343,7 +343,7 @@ static void free_qpn_table(struct rvt_qpn_table *qpt)
int i;
for (i = 0; i < ARRAY_SIZE(qpt->map); i++)
- free_page((unsigned long)qpt->map[i].page);
+ kfree(qpt->map[i].page);
}
/**
--
2.53.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v2 0/5] RDMA, IB: replace __get_free_pages() with kmalloc()
2026-07-13 7:17 [PATCH v2 0/5] RDMA, IB: replace __get_free_pages() with kmalloc() Mike Rapoport (Microsoft)
` (4 preceding siblings ...)
2026-07-13 7:17 ` [PATCH v2 5/5] IB/rdmavt: use kzalloc() to allocate QPN-map pages Mike Rapoport (Microsoft)
@ 2026-07-14 12:24 ` Leon Romanovsky
2026-07-14 12:28 ` Leon Romanovsky
2026-07-14 12:26 ` Leon Romanovsky
6 siblings, 1 reply; 9+ messages in thread
From: Leon Romanovsky @ 2026-07-14 12:24 UTC (permalink / raw)
To: Mike Rapoport (Microsoft)
Cc: Jason Gunthorpe, Dennis Dalessandro, linux-kernel, linux-mm,
linux-rdma
On Mon, Jul 13, 2026 at 10:17:21AM +0300, Mike Rapoport (Microsoft) wrote:
> This is a (small) part of larger work of replacing page allocator calls
> with kmalloc.
>
> My initial intention a few month ago was to remove ugly casts [1], but then
> willy pointed out that Linus objected to something like this [2] and it
> looks like more than a decade old technical debt.
>
> Largely, anything that doesn't need struct page (or a memdesc in the
> future) should just use kmalloc() or kvmalloc() to allocate memory.
> kmalloc() guarantees alignment, physical contiguity and working
> virt_to_phys() and beside nicer API that returns void * on alloc and
> doesn't require to know the allocation size on free, kmalloc() provides
> better debugging capabilities than page allocator.
>
> Another thing is that touching these allocation sites gives the reviewers
> opportunity to see if a PAGE_SIZE buffer is actually needed or maybe
> another size is appropriate.
>
> For larger allocations that don't need physically contiguous memory
> kvmalloc() can be a better option that __get_free_pages() because under
> memory pressure it's is easier to allocate several order-0 pages than a
> physically contiguous chunk with the same number of pages.
>
> And last, but not least, removing needless calls to page allocator should
> help with memdesc (aka project folio) conversion. There will be way less
> places to audit to see if the user was actually using struct page.
>
> Also in git:
> https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git gfp-to-kmalloc/rdma
Will you also change get_zeroed_page() in RDMA, or should I
prepare a patch?
Thanks
>
> [1] https://lore.kernel.org/all/20251018093002.3660549-1-rppt@kernel.org/
> [2] https://lore.kernel.org/all/CA+55aFwp4iy4rtX2gE2WjBGFL=NxMVnoFeHqYa2j1dYOMMGqxg@mail.gmail.com/
>
> ---
> v2 changes:
> * add comment to keep markers for sites that need "fast and as large as
> possible" allocation helper
>
> v1: https://patch.msgid.link/20260630-b4-rdma-v1-0-ab42bcf0de92@kernel.org
>
> ---
> Mike Rapoport (Microsoft) (5):
> RDMA/umem: ib_umem_get(): use kmalloc() to allocate page array
> RDMA/mlx5: replace __get_free_page() with kmalloc()
> IB/mthca: mthca_reg_user_mr(): use kmalloc() to allocate addresses array
> IB/mthca: allocate mthca_array memory with kzalloc()
> IB/rdmavt: use kzalloc() to allocate QPN-map pages
>
> drivers/infiniband/core/umem.c | 5 +++--
> drivers/infiniband/hw/mlx5/odp.c | 6 ++++--
> drivers/infiniband/hw/mthca/mthca_allocator.c | 6 +++---
> drivers/infiniband/hw/mthca/mthca_provider.c | 5 +++--
> drivers/infiniband/sw/rdmavt/qp.c | 8 ++++----
> 5 files changed, 17 insertions(+), 13 deletions(-)
> ---
> base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
> change-id: 20260610-b4-rdma-44625922fe16
>
> --
> Sincerely yours,
> Mike.
>
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v2 0/5] RDMA, IB: replace __get_free_pages() with kmalloc()
2026-07-14 12:24 ` [PATCH v2 0/5] RDMA, IB: replace __get_free_pages() with kmalloc() Leon Romanovsky
@ 2026-07-14 12:28 ` Leon Romanovsky
0 siblings, 0 replies; 9+ messages in thread
From: Leon Romanovsky @ 2026-07-14 12:28 UTC (permalink / raw)
To: Mike Rapoport (Microsoft)
Cc: Jason Gunthorpe, Dennis Dalessandro, linux-kernel, linux-mm,
linux-rdma
On Tue, Jul 14, 2026 at 03:24:56PM +0300, Leon Romanovsky wrote:
> On Mon, Jul 13, 2026 at 10:17:21AM +0300, Mike Rapoport (Microsoft) wrote:
> > This is a (small) part of larger work of replacing page allocator calls
> > with kmalloc.
> >
> > My initial intention a few month ago was to remove ugly casts [1], but then
> > willy pointed out that Linus objected to something like this [2] and it
> > looks like more than a decade old technical debt.
> >
> > Largely, anything that doesn't need struct page (or a memdesc in the
> > future) should just use kmalloc() or kvmalloc() to allocate memory.
> > kmalloc() guarantees alignment, physical contiguity and working
> > virt_to_phys() and beside nicer API that returns void * on alloc and
> > doesn't require to know the allocation size on free, kmalloc() provides
> > better debugging capabilities than page allocator.
> >
> > Another thing is that touching these allocation sites gives the reviewers
> > opportunity to see if a PAGE_SIZE buffer is actually needed or maybe
> > another size is appropriate.
> >
> > For larger allocations that don't need physically contiguous memory
> > kvmalloc() can be a better option that __get_free_pages() because under
> > memory pressure it's is easier to allocate several order-0 pages than a
> > physically contiguous chunk with the same number of pages.
> >
> > And last, but not least, removing needless calls to page allocator should
> > help with memdesc (aka project folio) conversion. There will be way less
> > places to audit to see if the user was actually using struct page.
> >
> > Also in git:
> > https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git gfp-to-kmalloc/rdma
>
> Will you also change get_zeroed_page() in RDMA, or should I
> prepare a patch?
➜ kernel git:(wip/leon-for-next) git grep get_zeroed_page drivers/infiniband/
drivers/infiniband/hw/bnxt_re/ib_verbs.c: srq->uctx_srq_page = (void *)get_zeroed_page(GFP_KERNEL);
drivers/infiniband/hw/bnxt_re/ib_verbs.c: cq->uctx_cq_page = (void *)get_zeroed_page(GFP_KERNEL);
drivers/infiniband/hw/bnxt_re/ib_verbs.c: uctx->shpg = (void *)get_zeroed_page(GFP_KERNEL);
drivers/infiniband/hw/mlx4/mr.c: mr->pages = (__be64 *)get_zeroed_page(GFP_KERNEL);
drivers/infiniband/hw/qedr/verbs.c: q->db_rec_data = (void *)get_zeroed_page(GFP_USER);
Thanks
>
> Thanks
>
> >
> > [1] https://lore.kernel.org/all/20251018093002.3660549-1-rppt@kernel.org/
> > [2] https://lore.kernel.org/all/CA+55aFwp4iy4rtX2gE2WjBGFL=NxMVnoFeHqYa2j1dYOMMGqxg@mail.gmail.com/
> >
> > ---
> > v2 changes:
> > * add comment to keep markers for sites that need "fast and as large as
> > possible" allocation helper
> >
> > v1: https://patch.msgid.link/20260630-b4-rdma-v1-0-ab42bcf0de92@kernel.org
> >
> > ---
> > Mike Rapoport (Microsoft) (5):
> > RDMA/umem: ib_umem_get(): use kmalloc() to allocate page array
> > RDMA/mlx5: replace __get_free_page() with kmalloc()
> > IB/mthca: mthca_reg_user_mr(): use kmalloc() to allocate addresses array
> > IB/mthca: allocate mthca_array memory with kzalloc()
> > IB/rdmavt: use kzalloc() to allocate QPN-map pages
> >
> > drivers/infiniband/core/umem.c | 5 +++--
> > drivers/infiniband/hw/mlx5/odp.c | 6 ++++--
> > drivers/infiniband/hw/mthca/mthca_allocator.c | 6 +++---
> > drivers/infiniband/hw/mthca/mthca_provider.c | 5 +++--
> > drivers/infiniband/sw/rdmavt/qp.c | 8 ++++----
> > 5 files changed, 17 insertions(+), 13 deletions(-)
> > ---
> > base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
> > change-id: 20260610-b4-rdma-44625922fe16
> >
> > --
> > Sincerely yours,
> > Mike.
> >
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 0/5] RDMA, IB: replace __get_free_pages() with kmalloc()
2026-07-13 7:17 [PATCH v2 0/5] RDMA, IB: replace __get_free_pages() with kmalloc() Mike Rapoport (Microsoft)
` (5 preceding siblings ...)
2026-07-14 12:24 ` [PATCH v2 0/5] RDMA, IB: replace __get_free_pages() with kmalloc() Leon Romanovsky
@ 2026-07-14 12:26 ` Leon Romanovsky
6 siblings, 0 replies; 9+ messages in thread
From: Leon Romanovsky @ 2026-07-14 12:26 UTC (permalink / raw)
To: Jason Gunthorpe, Mike Rapoport (Microsoft)
Cc: Dennis Dalessandro, linux-kernel, linux-mm, linux-rdma
On Mon, 13 Jul 2026 10:17:21 +0300, Mike Rapoport (Microsoft) wrote:
> This is a (small) part of larger work of replacing page allocator calls
> with kmalloc.
>
> My initial intention a few month ago was to remove ugly casts [1], but then
> willy pointed out that Linus objected to something like this [2] and it
> looks like more than a decade old technical debt.
>
> [...]
Applied, thanks!
[1/5] RDMA/umem: ib_umem_get(): use kmalloc() to allocate page array
https://git.kernel.org/rdma/rdma/c/66073100a7b857
[2/5] RDMA/mlx5: replace __get_free_page() with kmalloc()
https://git.kernel.org/rdma/rdma/c/e3d8c413e2e9e8
[3/5] IB/mthca: mthca_reg_user_mr(): use kmalloc() to allocate addresses array
https://git.kernel.org/rdma/rdma/c/5036553f0e39e2
[4/5] IB/mthca: allocate mthca_array memory with kzalloc()
https://git.kernel.org/rdma/rdma/c/45bf0b3da47d75
[5/5] IB/rdmavt: use kzalloc() to allocate QPN-map pages
https://git.kernel.org/rdma/rdma/c/f8d04b0c74e989
Best regards,
--
Leon Romanovsky <leon@kernel.org>
^ permalink raw reply [flat|nested] 9+ messages in thread