[PATCH v3 0/3] hv: vmbus: make rings and host-visible buffers survive buddy fragmentation

From: Emerson Busson

Date: Tue Nov 24 2026 - 16:40:59 EST


Opening new VMBus channels or subchannels can fail with -ENOMEM under
memory fragmentation even when plenty of order-0 pages are free, because
vmbus_alloc_ring() asks for a single high-order contiguous block (order-7
for a 512 KiB ring) and vmbus_alloc_requestor() uses contiguous
allocations for its request array and bitmap.

Based on Michael Kelley's review of v1 and the v2 feedback from Wei Liu
and Michael Kelley, v3 goes back to the core VMBus allocation path. It
groups buffer and GPADL state into struct vmbus_buffer, allocates ring
buffers through vmbus_alloc_buffer(), drops struct vmbus_gpadl along
with the duplicate decrypt/re-encrypt paths, and switches requestor
metadata to kvcalloc().

Changes since v2:
- Dropped the reclaim workqueue, UIO page-pinning layer, and KUnit tests
to keep this series focused on VMBus buffer and ring allocation.
- Split the hv_netvsc fixes and allocations out for separate net /
net-next submissions.
- Preserved hv_netvsc's revoke-failure leak guard before GPADL teardown.
- Rebased onto hyperv-next.

v1: https://lore.kernel.org/linux-hyperv/20260918014017.2536753-1-emersonbusson@xxxxxxxxx/
v2: https://lore.kernel.org/linux-hyperv/20261007190752.336426-1-emersonbusson@xxxxxxxxx/

Tested with x86_64 (W=1 C=2) and i386 builds, a local QEMU/KVM boot with
lockdep enabled, and a backport onto 6.18.64.1 running live on Hyper-V
x86_64 (85 VMBus channels, 12 netvsc queues, uio_hv_generic loaded).
Confidential VM paths (SEV-SNP, TDX, Arm64 CCA) were compile-tested and
reviewed by inspection only.

Emerson Busson (3):
hv: vmbus: encapsulate buffer and GPADL state in struct vmbus_buffer
hv: vmbus: allocate ring buffers via vmbus_alloc_buffer()
hv: vmbus: allocate requestor metadata with kvcalloc()

drivers/hv/channel.c | 363 +++++++++++++++-----------------
drivers/hv/hyperv_vmbus.h | 4 +-
drivers/hv/ring_buffer.c | 17 +-
drivers/net/hyperv/hyperv_net.h | 10 +-
drivers/net/hyperv/netvsc.c | 64 +++---
drivers/uio/uio_hv_generic.c | 97 ++++-----
include/linux/hyperv.h | 43 ++--
7 files changed, 271 insertions(+), 327 deletions(-)


base-commit: eab80895d447ec164a1d91a1ab377bd3a9dc9044
--
2.43.0