Re: [PATCH 1/2] crypto: zstd - use vmalloc() for stream workspaces

From: Chris Down

Date: Fri Nov 13 2026 - 14:31:49 EST


Hi Usama,

Usama Arif writes:
Use vmalloc() and vfree() directly to avoid the high-order allocation.

vmalloc() doesn't avoid high-order allocations any more. Since
a06157804399 ("mm/vmalloc: request large order pages from buddy
allocator"), vm_area_alloc_pages() first tries the largest order that
fits, and splits the block up afterwards. So for these 383 pages it still
asks for an order-8 block first, then order 6, 5, 4, 3, 2 and 1.

What the patch does avoid is kmalloc() rounding the 1.5 MiB up to a 2 MiB
block, which is where the 516 KiB per stream comes from. Maybe say that
instead?

Once that's fixed, please feel free to add:

Reviewed-by: Chris Down <chris@xxxxxxxxxxxxxx>
Tested-by: Chris Down <chris@xxxxxxxxxxxxxx>

Chris