🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22101

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

#22101
From: Emerson Busson
Date: Tue, 24 Nov 2026 21:40
49 lines
13083 bytes
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@gmail.com/
v2: https://lore.kernel.org/linux-hyperv/20261007190752.336426-1-emersonbusson@gmail.com/

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
Technical Details
Message-ID: <20261124214030.174246-1-emersonbusson@gmail.com>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370779-linux-kernel-netdev=dewy.ru

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370779-linux-kernel-netdev=dewy.ru
From: emersonbusson@gmail.com (Emerson Busson)
Newsgroups: linux.kernel.netdev
Subject: [PATCH v3 0/3] hv: vmbus: make rings and host-visible buffers survive buddy fragmentation
Date: Tue, 24 Nov 2026 18:40:26 -0300
Organization: Usenet Network
Message-ID: <20261124214030.174246-1-emersonbusson@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="44325"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:FNYoJfg8uMFExMq/mxuUjmdvXm8= sha256:sugwAg0445TMl2wO0Y+gmfgqBmvRjyNc/AYq4v+NLnI=
	sha1:dEdvuLq62hZTzqL7iF5NZy4Cs8o= sha256:70dhZl6LyN8oZp3j1OMogdMIc44w148HI27RoruJk1A=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 24369125E36; Wed, 25 Nov 2026 00:40:58 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 4Eul-2KNrGrl;
	Wed, 25 Nov 2026 00:40:54 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-370779-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 67A82125E33; Wed, 25 Nov 2026 00:40:46 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 116FE2ADE6; Tue, 24 Nov 2026 21:40:45 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795556442;
	b=zSnTFdsh9wb0zFOHQS0HmD+ME53F4TJprFnbzxDXUwPvyzTsWVqPj7pYo1XRSl+mSq0f
	 nrcP/kjqu0FzeTG6FTYhEC2mGTs/VH4ZAfcVPE04SuG36lIiXZFJt7WjIbT8cxgDZOKiu
	 CTJ9+QnXlAtBlW0rbOQw0ZnwzIvcOJpG8PX971yxqZ6bOKV4uZhjcLfbot7khbgDJcBX+
	 uoCOdjyBO7xMRLX1Ln1J3a04bzoZud7gTskZ28g8ht3CbfFshMQBctdULu7lFRxNzYiz7
	 mkRXKtn/uIWDan+2sho9uvkEa40AnWdCi0WrouBqU04OSHWeCFToLthyp6zgLN42TDg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795556442;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:Date:Message-ID:
	 X-Mailer:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding;
	bh=8vTHmqosNip4PzWeUJYtggJ3iETjixMqdrHE7e2DIQU=;
	b=k9Bv8CCo/kACYj1BofuigjwcJB2FbRJ8+6++j60h08A667lPtCINmXvFyLqVPHl2K5RD
	 k/g7/+UNbmRNOE6zYZuYw4ky63nFbIAwg7ta6yMh3m714O9HCZ5SNcZGc0omszDrTACVa
	 /ExTQpDxvrv3bdDeUqy6Md6eShqlviGOagAlHITq/kL3lSen9adloMis8Me1QL3tfAcYT
	 f6K75necQweNPaSec8RjgMPQ2+v82v7Z0Npe86PVTINltgfHQTkUo4sUUw4hTH8Aut4yJ
	 qMgbvO7NOQSgs4TRU3yWEWZLxBKkJOSxMeqj+1vyYmKQe1IYD8SjZdv4bV+JC0UwfRA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=0dm8TZPn;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 77B77606A338;
	Tue, 24 Nov 2026 21:40:42 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=0dm8TZPn
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.217.54
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795556441;
	b=twQPzbSoCLV08uB/Ye8hZVFu9zIwwpfB0OgkAXWXPXqk/xIdD1aUubBmk1LtrTxZm8DM
	 2OPLAaOTjyOF4J95Ycyb0NdfxdxCY1cg2xleqVDyB46voNdKM9N6DBWSAURtPCf5m7CWY
	 k6neB/ygb4P/MI/So4HQPiapkMpq+/AvIDmLMu1xHSi67ln5EDfXVC6zpGcJKiQCy3Tkw
	 XI19sZHcftmyI/HOdmKQ+w6iy1RSKyccd/ZVy4kEV45yjQeAWJ0Hwbh5xNfkwhnkOdvIl
	 eOmdq7/zGv+UrNrnjUDx27hL7RmN9UCojaO1cLh/DMddwyhc+GbP+paAUTYkpPMhtAw==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795556441;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version:
	 Content-Transfer-Encoding;
	bh=8vTHmqosNip4PzWeUJYtggJ3iETjixMqdrHE7e2DIQU=;
	b=ShfF6LT0fINokmGoTojwuJgIbPa6NkO3nciP5vKbyQcY+l+5UTEsXwGi1tFsd2vzYlt6
	 WDXR3bIvjYYYbOjPCpVh+b3SHHmxdpsW/fd/qBWPOhqfUAmSdIDPZ8zncOrKdqy2PhBvw
	 jo8BSitsfNFammHjeAgtt5cjnW0Znk86rJJ1BZpOr+n9FdPnUjs23bb8xDvcUNZ2Zuerm
	 Mv6RB0RFJMSufWuBWRMLTjCYNYyOQW+sOyvWv5Ou5mdbP5rGMaDSRf2QDrKc9z79Drful
	 EnUYCYrwhOYswjFVPZsWJ06kUQSC1Bkud3HVtx7RDqlYnFsvQL6Kq7dVfiP8gm75KJA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=0dm8TZPn;
	arc=none smtp.remote-ip=209.85.217.54
X-Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCB24606A337
	for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 21:40:40 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DCB24606A337
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-vs1-f54.google.com with SMTP id ada2fe7eead31-7d2ccd3c7a2so1693556137.0
        for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 13:40:40 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1795556440; x=1796161240; darn=vger.kernel.org;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
        bh=8vTHmqosNip4PzWeUJYtggJ3iETjixMqdrHE7e2DIQU=;
        b=0dm8TZPnqEQFkRwrXxHnx5HZPGepIu1i6nigAX8fz59SVnfIllA8zMxlg3Qi9rP5Cg
         7ClvnriYq4VPEpzMNIS3/f8hggdOpXqQdl3PPfA2Oj8Hjl2Sa5Hbfhfp334XFOefTygp
         sObv+L1JJcptSBZf0n86Jfe7pgshaMgdFHPa9w3f6WSQSS2lDo1kvreb5PZYZGOfASXS
         2Uvxd/y/Aar6NS3QS/KoCASWJJLTnEj63HO7XKyBhwG8JvCGCZeyNduZeNG7776oJVTb
         5sqlxeuIzjpa5Jj0XO9Mrd4a0Wm2x+0wKX43lKE5COetTQqfkPwO//WKpKovDnUblHZo
         uWWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1795556440; x=1796161240;
        h=content-transfer-encoding:mime-version:message-id:date:subject:cc
         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
         :message-id:reply-to:content-type;
        bh=8vTHmqosNip4PzWeUJYtggJ3iETjixMqdrHE7e2DIQU=;
        b=gFG49rH3FpUsDe4jj+iHOaxLCsPT0jqo01COJxUBsMlm9zKCXHAxu6HPPEuudh/1Ak
         9jJTlSLJyniBU8/3TDi1crVqw4x3a8BYhVbvcVRRSL+bksI5aCDi8B8o1rJl4G/xRw7Z
         8dEWXjBbozfBd9PyT5tOm4oMb8+iaK/GDBhlYBCyuxJV0HVwYBWf6vgpEu+y+8JSAocS
         nhn0oYBKCt6TPhGfycpngF2BsZtpWpZfHV6HR+2XoqH4GsMbbX7OBApVFiYTq8Z+7YI7
         NojkIWeVLzU4LKefI4VophyndRedYKjkoEBW6O0I65TTD3nMuLFdY+KvNRbahYu49gMd
         IS4A==
X-Forwarded-Encrypted: i=1; AL+hErFaa/kFJUMb/b3cXcIGcDl3lWQ/XlZgyYCVsj6aRR0b8fgeYVy/nRpsLWmNk1TvqMfzG8MF148=@vger.kernel.org
X-Gm-Message-State: APuU4Z8X3ugw4gpYRWf63aSbGFyH8YCUvwQqad0hwUeHxZarA6c7Fbfy
	2K5kZW0WV/+xHXr22tAofP2jD2LqzsDJRJn7RXqG3YJFUCIXU9sfd7Cw
X-Gm-Gg: AZFdTZfm7IXQ9P1anWxxNLhNRIkMBORn1OSOE6orI/bdFfRxRlQpG2qtnDjlztwibq4
	HlU/aih4pFX998O+tNGxj1/nBNe8rhhETcfQzgYrVR2a8aEzUm5DZ2StQQzcKo5GU45vo2M+ChW
	zgmY8vByeekViKaP7X8Ehu67BpMJZZoEuZFkkWKf4T7bCaWZrkUK9FoBpjIKbxZmD1nwW0fX63k
	3UnAWGKBAQzrWEYLnjwmthmntFdZaUqaFj8buAUAtGCLtSU2ODoyf9XDyiIYPAEaQyQONtB/2LU
	S4PhnTPko96t/CDGmMMW4xfACi3zWNG6SD2JEtNoC7iEgguaz9OuiE2rUdsLaFltalgSf4urUmW
	cVxwFWV8HJ1Eq7FUEWjbd8rgISzO5Ar8M2VI/THTaax5yKCFreRNrLNoQb4TWSkmqwjLsUmbisY
	/O+iZ7u0imUzeOv1rZmxpSC2sJoSTEERELs2B0pM5syvdmcDP1pFhuZR4pcavHitjWJ6+bczKlD
	pS/Zz/7C3q+tWAfVDSwst8lP2cv16Nu4AHcN5uj/B19CYB21VvfhpbOwXI1fTOAoEIAwiSFzwLf
	IgyIIUk2HpH1g0werCN7HMzHXTl3q+5JkN/lcnyF0Ff5i3WFK/XO
X-Received: by 2002:a05:6102:292a:b0:7a6:d11b:16ea with SMTP id ada2fe7eead31-7d73935fb84mr8027697137.6.1795556439674;
        Tue, 24 Nov 2026 13:40:39 -0800 (PST)
X-Received: from emedev.tailf75c28.ts.net ([179.238.117.100])
        by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-99e6dec57ddsm15952879241.1.2026.11.24.13.40.34
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Tue, 24 Nov 2026 13:40:39 -0800 (PST)
X-Cc: Michael Kelley <mhklinux@outlook.com>,
	Easwar Hariharan <eahariha@linux.microsoft.com>,
	Kameron Carr <kameroncarr@microsoft.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	linux-hyperv@vger.kernel.org,
	netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
X-Mailer: git-send-email 2.43.0
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list