Article View: linux.kernel.netdev
Article #297[PATCH v2 14/14] hv: netvsc: use kvzalloc for device state
From: Emerson Busson
Date: Wed, 07 Oct 2026 19:07
Date: Wed, 07 Oct 2026 19:07
44 lines
9676 bytes
9676 bytes
alloc_net_device() allocates the fixed-channel netvsc_device with
kzalloc_obj(). The runtime fragmentation drill reaches this allocation
from netvsc_device_add(): windows-2025 reports an order-7 allocation
failure with about 99 MiB free, while windows-latest stalls at channel
open until the guest timeout.
This object is guest-private control-plane metadata, not DMA backing.
Use kvzalloc_obj() so the allocation can fall back to vmalloc when a
high-order kmalloc cannot be satisfied. Zero initialization is preserved.
The RCU workqueue cleanup uses kvfree() to release either backing.
Rollback trigger: revert if channel setup fails with vmalloc capacity
available or teardown leaves netvsc_device allocations outstanding.
Signed-off-by: Emerson Busson <emersonbusson@gmail.com>
---
drivers/net/hyperv/netvsc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 0d017f836b9e..8ea7c993baac 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -144,7 +144,7 @@ static void __free_netvsc_device(struct netvsc_device *nvdev)
vfree(nvdev->chan_table[i].mrc.slots);
}
- kfree(nvdev);
+ kvfree(nvdev);
}
static void free_netvsc_device(struct work_struct *w)
@@ -171,7 +171,7 @@ static struct netvsc_device *alloc_net_device(void)
{
struct netvsc_device *net_device;
- net_device = kzalloc_obj(struct netvsc_device);
+ net_device = kvzalloc_obj(struct netvsc_device);
if (!net_device)
return NULL;
--
2.43.0
Technical Details
Message-ID:
<20261007190752.336426-15-emersonbusson@gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342498-linux-kernel-netdev=dewy.ruReferences:
<20261007190752.336426-1-emersonbusson@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-342498-linux-kernel-netdev=dewy.ru
From: emersonbusson@gmail.com (Emerson Busson)
Newsgroups: linux.kernel.netdev
Subject: [PATCH v2 14/14] hv: netvsc: use kvzalloc for device state
Date: Wed, 7 Oct 2026 16:07:52 -0300
Organization: Usenet Network
Message-ID: <20261007190752.336426-15-emersonbusson@gmail.com>
References: <20261007190752.336426-1-emersonbusson@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="717662"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Iu9HTAWtEZ0nUiB9IanIhjnVlXM= sha256:nTGXlV2rjINgHEkz7a5IvwTREPGw+hOpB0FKYrxHEMU=
sha1:RHE1GVvvT01G2KttWXSgSoyazFQ= sha256:EAHJOAQnvTdsduUC6gWbIMYa5u0/xWpp6nsPqv75vmg=
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 C8AC310F210; Wed, 7 Oct 2026 22:10:55 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.849
X-Spam-Status: No, score=-0.849 tagged_above=-9999 required=6.31
tests=[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,
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 kD39VBwbx2Hm;
Wed, 7 Oct 2026 22:10:53 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-342498-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
by mail.dewy.ru (Postfix) with ESMTPS id 9750D10F212; Wed, 7 Oct 2026 22:10:50 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by sto.lore.kernel.org (Postfix) with ESMTP id 5C3BE607B37; Wed, 7 Oct 2026 19:09:51 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 0933C4E3EE8;
Wed, 7 Oct 2026 19:09:27 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UyKU9oV/"
X-Received: from mail-ua1-f46.google.com (mail-ua1-f46.google.com [209.85.222.46])
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id CA7154E3259
for <netdev@vger.kernel.org>; Wed, 7 Oct 2026 19:09:25 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.46
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1791400166; cv=none; b=OMACns7qcxw4WGCEosXXsuL73j1/h6AmQS6p5BPG33dOHli2DkEoobV2fUrTZzocKm1Mr7RbGSVU9ycm7Wgm9XPHbLKdFMj+MUGFjveUsPyu2fYPMGbUY41Gj2k9wZEhW4R2ycEmWtIh5w126ChXyz1eisPKT+nqHE9KKBjOK94=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1791400166; c=relaxed/simple;
bh=vVSqOGp2wx/0qJVjAsSbH5oTy4Gpsm8b9+BCotcy5AA=;
h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:
MIME-Version; b=A4LoBtlcT2QVmnflpt1NzJVeUsNdRtcVbc4uBB+viBNKe1emXDlBF5MHGoa6QdGZHrSGB/5zG2sBngKfG2N7uHuMlNpN5YIEjJYCZsE4ez31BPvVUwE/+IVCew/DJZtOmqLu3ASmxyVY123JjT6uNqNKmAc+GCWlpLQV8wBsgd4=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UyKU9oV/; arc=none smtp.client-ip=209.85.222.46
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-ua1-f46.google.com with SMTP id a1e0cc1a2514c-97ca72f2cd9so1132518241.2
for <netdev@vger.kernel.org>; Wed, 07 Oct 2026 12:09:25 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20251104; t=1791400165; x=1792004965; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:references:in-reply-to
:message-id:date:subject:cc:to:from:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=3XGvHahoLRouhu1JIBcDAOTwzFgHXehCkZsR1IWSJgU=;
b=UyKU9oV/Skj6omKIj79jVBpXFg+ATjDAhM9sqCUH9n7N5aK52iQU92wyj/ba8d5V4A
S0zg7dUjAV6GAyUZWdQJaly3O91FpSYaNiL+BIO05/eGEEU1aA0iY18E5QjhonwDRVqC
2RNfUEvuSB58m5AxmJlT2oIdzZXLYabSU8gb4OAgmFCwJ3cOcQjEnW9xeW5yhGJ6qk0+
NOkBOn7Yx6d87Vuen2T8VFNR1vRfvw0/OvpuXf8DIiOUgG0cn6v+5sW1logY/xmMAN7V
10Mza0jE1vixG8/LbiHHKSr3bqIH9aS6Ct27KVNk9TvCcFVJe3Houcp6+C9RQI+BqFKP
JEBQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1791400165; x=1792004965;
h=content-transfer-encoding:mime-version:references:in-reply-to
: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=3XGvHahoLRouhu1JIBcDAOTwzFgHXehCkZsR1IWSJgU=;
b=rC9J7Mi0zktVV8tRIyXwAxkGx3JtB/zJFi5GYRUDWRT0HRspv+qyvtd/h+G93ECDRK
L38hPAIpNSQD+Ov4R48Uk9jo7pV30Gu7SXH7Bfix44U/fSgE5KVj+68X2e64r8n5boID
xf9LUdlPAmoaw5ZdjHpHJyXpTPddAz5Z3DtOzlz9thmheuCTzUdltzG7uBncTUGkjNmC
wyXRRoXwOA3JUSb1l83QiU4gNkJ3IDPZP8f0S2yq7n8dbW5G3lEHcudjG1qyeWbStmhy
YNLLqZ4PTk/DQYLRSGDP6Ux0tY3PxJjlmx8FpETqgKI7P5OdB9vky3lnUCqNCFw1Zv8M
jlAg==
X-Forwarded-Encrypted: i=1; AKwUvBzyxRaSfN0kZDq+qqLWBReorErMQCZY64O1frFlwzBhtNyqZxsxbACX8H0Bvu1PVumxRtEG9eY=@vger.kernel.org
X-Gm-Message-State: AFq9FYJQQ+s4OMqzxxL7wOrxQErn0arls0dPZgbrYjY0u2ykWgzFN43a
MxkQhDprvOKCGva753VLwhTttPp2vipWgMpLQTAMj03kRnZCcRKWiV2k
X-Gm-Gg: AYBFou1bdT+/CK4JW+dp1mGsw6bBZorJihvrcu4UvOPlBfoa0bCCydb4PeO3LXOoV31
FOhz/F6JwEqA/eqLeK1AFGmdz2+Lq/6/knrANYW0kBJ5vOVuQ3scDD4+hzUF4V2zz7HB8e+q7kD
7+ZL3lwRWBRseVQrBhJ1IjkNg88U7jrfgb9pBOgGCb71ngiqNqd89oroxh2Z5SIqNLjHonJszaV
mennbYzha/J0rrc6Pto/YfFrhppmFa3dAD75kZ6S4UtaXphUpYGiy/XkArCgVLX1bUGydAOcJ3r
yMqbK/8Dq8euc5tSGoA3f2P+nkbhCzu5rgSEXWv5ejpwcOolzWwndn8uBsiit19Bc0uMIsZms15
iwxp0pTz3TaX6MRHkqZSwFe9d6T8694Z5lgzIjazn3BY/lvynvZ0I4D+NW2tSlygIEXemrAkoj7
8xioGafBc844MG8yI+dO/Ag8Cb1Xcnd6j0irVBmFtffd2kfW4Pcp1pSUF7fuq7VDk/oW6uylGzE
oK02asKqN6EDKl4Fd0=
X-Received: by 2002:a05:6102:688f:b0:7bc:1de3:39b0 with SMTP id ada2fe7eead31-7ca38f28c27mr1016377137.32.1791400164748;
Wed, 07 Oct 2026 12:09:24 -0700 (PDT)
X-Received: from emedev.tailf75c28.ts.net ([74.244.222.41])
by smtp.gmail.com with ESMTPSA id ada2fe7eead31-7ca218138c6sm2456787137.12.2026.10.07.12.09.19
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Wed, 07 Oct 2026 12:09:24 -0700 (PDT)
X-Cc: kys@microsoft.com,
haiyangz@microsoft.com,
wei.liu@kernel.org,
decui@microsoft.com,
andrew+netdev@lunn.ch,
davem@davemloft.net,
edumazet@google.com,
kuba@kernel.org,
pabeni@redhat.com,
gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org,
linux-hyperv@vger.kernel.org,
netdev@vger.kernel.org
X-Mailer: git-send-email 2.43.0
X-In-Reply-To: <20261007190752.336426-1-emersonbusson@gmail.com>
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>