Article View: linux.kernel.netdev
Article #11417[PATCH net 0/3] vsock/virtio: bound what a peer can make the host queue
From: Oleg Drokin
Date: Thu, 05 Nov 2026 00:01
Date: Thu, 05 Nov 2026 00:01
54 lines
9357 bytes
9357 bytes
A virtio-vsock peer that does not consume what it is sent can make the
local side queue memory that no limit covers. On a host the peer is a
guest, and the memory is GFP_KERNEL, charged to no memory cgroup. Two
ways remain on net/main:
- the send credit trusts the fwd_cnt the peer reports, so a peer that
never reads but keeps acknowledging gets unlimited credit (patch 2);
- credit updates are not bounded at all: a peer can solicit them with
OP_CREDIT_REQUEST, or by sending small packets that a reader drains,
while posting no rx buffers (patch 3).
Patch 1 fixes the accounting of packets that vhost drops on rx errors;
patch 2 relies on bytes_unsent being right.
Nothing changes on the wire.
Tested in an x86_64 qemu/KVM guest running the kernel under test
(net/main 03897066069f); the "guest" is a user-space program driving
/dev/vhost-vsock directly, talking to plain AF_VSOCK host sockets:
case net/main this series
lying fwd_cnt, no rx buffers, 2 s of 256 MiB 256 KiB
non-blocking send() on one socket queued (one window)
20000 OP_CREDIT_REQUEST, no rx buffers +18.5 MiB +0
20000 1-byte packets, each read by host +18.0 MiB +24 KiB
vsock_test from tools/testing/vsock passes over loopback and between a
nested guest and its host. A bidirectional stress test (up to 512
connections streaming both ways, readers draining in small reads) runs
without stalls, and vsock_perf throughput stays within run-to-run noise.
With KASAN and lockdep enabled, these tests show no reports.
The reproducer (a small user-space program that drives /dev/vhost-vsock
as the guest) is available on request.
The patches, the test setup and these changelogs were prepared with an
AI coding assistant (Claude); the tests above were run as described.
Oleg Drokin (3):
vhost/vsock: release the accounting of packets dropped on rx errors
vsock/virtio: bound the send credit by bytes not yet consumed by the
transport
vsock/virtio: queue at most one credit update per socket
drivers/vhost/vsock.c | 25 +++++++--
include/linux/virtio_vsock.h | 5 ++
net/vmw_vsock/virtio_transport.c | 2 +
net/vmw_vsock/virtio_transport_common.c | 69 +++++++++++++++++++++++--
net/vmw_vsock/vsock_loopback.c | 1 +
5 files changed, 95 insertions(+), 7 deletions(-)
--
2.56.0
Technical Details
Message-ID:
<20261105000141.3617241-1-green@linuxhacker.ru>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356996-linux-kernel-netdev=dewy.ruShow 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-356996-linux-kernel-netdev=dewy.ru From: green@linuxhacker.ru (Oleg Drokin) Newsgroups: linux.kernel.netdev Subject: [PATCH net 0/3] vsock/virtio: bound what a peer can make the host queue Date: Wed, 4 Nov 2026 19:01:38 -0500 Organization: Usenet Network Message-ID: <20261105000141.3617241-1-green@linuxhacker.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3529548"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:pu0kFuFsIbQG+yGPMstJsKJx3jE= sha256:SN4XerBZfB4qpFhPILlTijlhWNfyuiPK9Uy36chxYfI= sha1:30ADP+crG0tf0jUP/LgIccqJMYc= sha256:ZKh5f6PYTRNGnlvJXrbAlGUhaXG3Q8/gWkyP6hYjbWo= 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 D50C5112E32; Thu, 5 Nov 2026 03:54:48 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[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-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 1hcGbNF0BJxn; Thu, 5 Nov 2026 03:54:45 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-356996-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linuxhacker.ru X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id C9504112E0B; Thu, 5 Nov 2026 03:54:44 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 4372961686C; Thu, 5 Nov 2026 00:02:28 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=fail; t=1793836930; b=zzf+oVnAzdRW+AX8WY6FXbFzFLiFSYyp1OSRVj/I3H9cXFNnved3TnjQvKgftXeeGvmc IXpbXxT8Fr7vF+6BnMr6jgxxxvT85IaJBEHGgjr2YHM24vnkdzFSn6uccE+n73SDvOSM8 YPUR2HHMr7pZERUO7ys0Bru6ZtaZllAdVR0NV5RuW4Va1FzYkNbYjaM3v8WIf9A5XerRD 460xO1jsB/+VwvPnsMY78DSKhC4nNAmSb2bspiVCiDQ9C1irX5MGo2kby+m02ZW4JD29/ dDDfE8WyQ7IopKtoDD6+NUaI34Vjywh+0QyN+say9hX9XQ++8oxJpRfDlJLA61E31PQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793836930; h=X-Original-To:Received:DMARC-Filter: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=oLJyanmstYagcI9Rv5WYzf+IYeOCfgcugYDSw4IlpLU=; b=jOypPlkGitJtHVfDpfuh0Z0SbKMXr87hHA+BLmhqqAK/D8sWWcgwQquCyLFbIPbbvCVS YVFzRI4+79iyuWM3mte4ESpou4HAz/qbFhKhKcyXeiGHlf706P8CRYhdtkohcG77a27Tl Rhy4yiYcUOqGulyGXq11+rd4tTNzjMRoccGKWE950fTie0HThOk7NbM6IPHVekDYVaW2A 9Eo+FnVNRwS8xbjVu50RQJBJjlgQgEjFhBdVI3v9NmSAAa7rvDxxDyFvxf4SL7e9joQqA yR2lB3H5zKr5c8dADZYaxRXm1zEeoiiw3vSWIEAnQbUCSKhoQLW5IfLkLRSndlvKyAQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none header.from=linuxhacker.ru; spf=none smtp.mailfrom=linuxhacker.ru; arc=fail 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 2E258606D81A; Thu, 5 Nov 2026 00:02:10 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=159.69.87.85 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793836929; b=IMgh7jfL7uGV91V7OQGx279+/TYfs5+BX4CM7soOUYwFvp9l7L6tft0aG2adg2Ytramc xiJrIYFP3eRjXVdAf0W7zze+7cXnnoXZkzYyezryctFNk3dMkr9ASgvNewU+xywirUH3Q YxUtWqfp9YiDHWR86HpfBvKFHv9In7Bg8Wd6GrRVoxjJrQmxLf50nczj0B/DSaGgwds6/ mqXcIlXZjbeo2TTboSfVqZMy/Z5ZI1tVq6MuUFgAnZRcg45cSoonfvJ92MU0buZ3pgQL6 Q/JLzCPwCgQ9/F+SyvuD/+f3HKdZKruDZg60WPOUQ0Uyz/AgigJMzz9EpiXu0DVaPfQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793836929; h=DMARC-Filter:Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer: MIME-Version:Content-Transfer-Encoding:X-Spam-Status: X-Spam-Checker-Version; bh=oLJyanmstYagcI9Rv5WYzf+IYeOCfgcugYDSw4IlpLU=; b=jtH1xcf5p8wngdg/82jFGykX7SYQh4HnPpcoHI1TE7mmHstz4a4g9ZhDDc3nWxvZz276 iGjJ5GU07Ify4Hq3bhi0k4l5X4iqYXUpCRKSqlSA/JPhHZDP4eVK49SVOnTODY2LSh4w6 o5q/7k25/QuLKbGKryt0dp2PjhswVUVa6IbUwYZ4yUj1oOGChaht8a+kJynb9ayYzSqlf rz6Sj7RG0yfSsxGbftV43c8AcL6thp7kxE7bpRVJMixn/nDWdUCDCc9Y+aqh6tgJjyFep WUMt3QtfrrNzK/o6F+eo9f+IWfEZmSBmcTmoY5IpskCelo0Q5LMzeVzLzb2K+BGs5HQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=linuxhacker.ru; spf=none smtp.mailfrom=linuxhacker.ru; arc=none smtp.remote-ip=159.69.87.85 X-Received: from eagle.linuxhacker.ru (linuxhacker.ru [159.69.87.85]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C92B5606A326; Thu, 5 Nov 2026 00:02:07 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C92B5606A326 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linuxhacker.ru X-Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linuxhacker.ru X-Received: from intelbox1.virtnet (unknown [162.81.204.199]) by eagle.linuxhacker.ru (Postfix) with ESMTPSA id 82E49BEE42; Thu, 5 Nov 2026 00:01:57 +0000 (UTC) X-Cc: jasowangio@gmail.com, eperezma@redhat.com, xuanzhuo@linux.alibaba.com, bobbyeshleman@meta.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, netdev@vger.kernel.org, virtualization@lists.linux.dev, kvm@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: git-send-email 2.56.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