v2
2026-07-13
RDMA/IB 替换 __get_free_pages 为 kmalloc · v2
将页分配器调用替换为kmalloc/kvmalloc,改善API一致性、调试能力并减少对struct page的依赖。
原始补丁链接
子 Patch(5)
1/5
RDMA/umem: ib_umem_get(): use kmalloc() to allocate page array
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
2/5
RDMA/mlx5: replace __get_free_page() with kmalloc()
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 t
3/5
IB/mthca: mthca_reg_user_mr(): use kmalloc() to allocate addresses array
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 allocato
4/5
IB/mthca: allocate mthca_array memory with kzalloc()
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() do
5/5
IB/rdmavt: use kzalloc() to allocate QPN-map pages
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() provi