[PATCH 1/2] nvmet-rdma: Use kvcalloc for commands and responses arrays
Keith Busch
kbusch at kernel.org
Mon Nov 24 11:35:36 PST 2025
On Mon, Nov 24, 2025 at 08:49:20AM +0200, Israel Rukshin wrote:
> Replace kcalloc with kvcalloc for allocation of the commands and
> responses arrays. Each command structure is 272 bytes and each
> response structure is 672 bytes. These arrays typically exceed a
> single page, and grow much larger with high queue depths
> (e.g., commands >2MB, responses >170KB)
>
> kvcalloc automatically falls back to vmalloc for large or fragmented
> allocations, improving reliability. In our case, this memory is not
> aimed for DMA operations and could be safely allocated by kvcalloc.
> Using virtually contiguous memory helps to avoid allocation failures
> and out-of-memory conditions common with kcalloc on large pools.
Thanks, applied to nvme-6.19.
More information about the Linux-nvme
mailing list