πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26993

[PATCH net-next v7 0/2] vsock/virtio: reduce RX per-packet socket overhead

#26993
From: Jia Jia
Date: Fri, 04 Dec 2026 15:11
116 lines
16443 bytes
This series reduces per-packet socket overhead in the virtio-vsock RX
worker.

Patch 1 separates socket lookup from processing under the socket lock.

Patch 2 retains one socket lookup reference and socket lock across a
bounded run of established STREAM/RW packets for the same socket.

Performance:

The measurements below cover both patches. Throughput uses vsock_perf as
the host sender and a custom single-threaded blocking receiver in the
Guest, with the receiver on CPU0 and the virtio-vsock IRQ/RX worker on
CPU1. Each row has 16 accepted, balanced AB/BA pairs and a fresh Guest per
state. The fixed-syscall campaign was collected separately; each table
compares paired baseline and series runs from its own campaign. The host
uses vhost-vsock.

Accepted runs also passed byte-integrity, CPU-affinity/migration,
IRQ-activity, host/Guest steal, I/O-wait and swap, sentinel,
kernel-diagnostic, and applicable perf-validity checks.

End-to-end RX throughput
(64K Guest recv() size, SO_RCVLOWAT=1; Gbit/s):

  payload  baseline RX  series RX  throughput change (95% CI)
           (Gbit/s)     (Gbit/s)
  64B          0.1212      0.2555  +110.81% [+106.99%, +114.70%]
  256B         0.5551      1.0212  +83.95% [+79.94%, +88.06%]
  512B         1.0568      1.8761  +77.53% [+73.02%, +82.15%]
  1K           1.9260      3.1453  +63.31% [+58.58%, +68.17%]
  4K           3.9497      7.5715  +91.70% [+86.36%, +97.19%]
  8K           4.8355      8.0738  +66.97% [+62.71%, +71.33%]
  16K          5.4708      8.0804  +47.70% [+44.61%, +50.86%]
  64K          5.8880      8.2147  +39.52% [+35.87%, +43.26%]

Fixed-syscall stress test
(receiver recv() size = sender write size; Gbit/s):

  payload  baseline RX  series RX  throughput change (95% CI)
           (Gbit/s)     (Gbit/s)
  64B          0.1435      0.2750  +91.60% [+82.19%, +101.50%]
       recv() calls (baseline/series): 1048577/1048577
  256B         0.4218      0.9659  +129.00% [+110.65%, +148.95%]
       recv() calls (baseline/series): 1048577/1048577
  512B         0.8062      1.6979  +110.60% [+94.49%, +128.04%]
       recv() calls (baseline/series): 1048577/1048577
  1K           1.5116      2.9585  +95.72% [+85.22%, +106.82%]
       recv() calls (baseline/series): 1048577/1048577
  4K           3.0190      6.3147  +109.16% [+99.17%, +119.66%]
       recv() calls (baseline/series): 537756/525298
  8K           4.0434      7.3899  +82.76% [+75.28%, +90.56%]
       recv() calls (baseline/series): 276505/263947
  16K          4.9556      8.2543  +66.56% [+61.89%, +71.38%]
       recv() calls (baseline/series): 147233/132504
  64K          5.8581      8.2548  +40.91% [+36.91%, +45.03%]
       recv() calls (baseline/series): 50990/33103

Request-response latency
(ping-pong RTT, 10,000 requests per state):

  payload  baseline mean RTT  series mean RTT  change (95% CI)
           (us)               (us)
  64B               121.067           120.977  -0.07% [-2.45%, +2.36%]
  256B              120.733           120.809  +0.06% [-1.69%, +1.85%]
  4K                123.161           121.525  -1.33% [-2.87%, +0.24%]

---
Compared with v5, the performance suite was rerun with stricter validity
gates, including host/Guest scheduling, steal, I/O-wait and swap
monitoring, plus QEMU affinity and migration checks. Runs affected by these
sources of noise were rejected, so the current results better isolate the
RX batching improvement.

v7:
  - remove the redundant buf_used + len batch eligibility check and the
    now-unused len arguments
  - drop the 64K byte cap and virtio_transport_rx_batch_can_add();
    the packet count advances by one per packet, so the post-processing
    check ends the batch at 64
  - remove the sk_prot and psock eligibility checks left over from the
    notification-deferral patches, along with the associated single-packet
    fallback branch
  - restore the original trace_virtio_transport_recv_pkt() signature now
    that the batching path adds only one call site
  - rerun 4K, 8K, 16K and 64K throughput tests after dropping the byte cap;
    end-to-end RX exceeded the v6 byte-capped results at every size, while
    fixed-syscall RX exceeded them at 8K-64K and was 0.34% lower at 4K
v6: https://lore.kernel.org/netdev/20261127062700.29387-1-physicalmtea@gmail.com/
  - keep patch 1 unchanged apart from Stefano's blank-line nit, and add his
    Reviewed-by tag
  - drop the metadata-budget helper and the rx_buf_full() batch boundary
  - apply Bobby's receive tracepoint refactor in the batching patch
  - remove the locked helper's batch-specific parameters; return packet
    validation status and keep the continuation check in the batch caller
  - keep sockmap eligibility checks at packet boundaries without taking
    sk_callback_lock
  - move notification coalescing and deferral to a separate follow-up
    series
  - update the performance measurements and add fixed-syscall stress results
v5: https://lore.kernel.org/netdev/20261103041134.33310-1-physicalmtea@gmail.com/

Jia Jia (2):
  vsock/virtio: split socket lookup from locked RX processing
  vsock/virtio: amortize RX socket locking for stream packets

 include/linux/virtio_vsock.h            |  22 ++
 net/vmw_vsock/virtio_transport.c        |   7 +-
 net/vmw_vsock/virtio_transport_common.c | 310 ++++++++++++++++++++----
 3 files changed, 285 insertions(+), 54 deletions(-)


base-commit: 8df0638138d3e0344fd1fb36cf2d1ca1cf5028f0
-- 
2.53.0
Technical Details
Message-ID: <20261204151103.113676-1-physicalmtea@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-377430-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-377430-linux-kernel-netdev=dewy.ru
From: physicalmtea@gmail.com (Jia Jia)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v7 0/2] vsock/virtio: reduce RX per-packet socket overhead
Date: Fri,  4 Dec 2026 15:11:01 +0000
Organization: Usenet Network
Message-ID: <20261204151103.113676-1-physicalmtea@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2792152"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:8lMgpAebYG77gDHpKp0e+dq7MSI= sha256:uwMyCnlCDN2FuxqpKuKrgVXgftzWjg1+56gjbiqShMY=
	sha1:cVQ2i854rO1EOlCZKRZ2J9cG88g= sha256:ZwNMsHtRFljzYGwb1g8qDkS6Ig7ydbmOmSvcGljp3XU=
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 D2ED4117C41; Fri,  4 Dec 2026 18:12:16 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.297
X-Spam-Status: No, score=-3.297 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.001,
	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 TLGYJSXR7r8K;
	Fri,  4 Dec 2026 18:12:13 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377430-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 38779117C13; Fri,  4 Dec 2026 18:12:04 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id B85D4469C4; Fri,  4 Dec 2026 15:12:00 +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=1796397118;
	b=gTcbk7drL35b7/WmsZ7wjw6qxSukZ3ol8Rj/j8z5jIVXM6Oao8pRAEeoI1KA5Cj4Z+80
	 +sB407hQx6RPot8Lhc+oJJx0jjjMCn//whxEzGkERlnyZMjQJfo5tCYhryBpYYvmq03l2
	 /cl+6bdJblGvaTKMjr+Mw/sP3JHV1sIorE2tzy/e0Op9WsUaXB1ewEROSJ6uBynAFnIaY
	 oOneW6bQsyliYzUrCRYw/S9J5OzHfkGLa+kZlBHei1wD27uSn17aQTRine086yG4tk9qk
	 xpIZux60Wv+9rBd35C+xqcD2237xQsrRow7D8svHVToM41tLTa021avxSZ39/qxw+TQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796397118;
	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=jDlb0mnhaflLk77aULzhoOnE7HtjK3JF1HgTy7ULxyY=;
	b=07E1ZZrbYAYeOcnkHK9jU5ck3acadArhJp3WIVm3URiAbGQpN8303AZqcKAHA/1FQWkq
	 STd84kj6a/EeC9t3h8YSG6uTY/bizS2NecgwdeKDRCcqKT62izahIs//KPH6ew5YJ4pvs
	 DNyQmIq/aJfMlmiV70PQSBaHeRgNZzRpWeV/XF2eLH/6S6cJCLjfgVfwxvMvEISLSMwZi
	 +cKkxbHXn/EZSnwNtAVpQ5YZd3MyBn5wq4M5rgKGhseAMs1u1GJfrg2pE8sdaW4tsKdDw
	 Oz7hs9Y+W94LSqHwHNVA7scvPpeBpEQf9Myp9Y97Jm7aK7vATcwKJ2Vv/jx8XUXjHHw==
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=OmWmdoEd;
	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 4BE41606A692;
	Fri,  4 Dec 2026 15:11:58 +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=OmWmdoEd
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.174
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796397117;
	b=YOs4qTsERXnDzXYehR++rE9xbT6hNZ/kBmsv2evzhYhxT6XCvtvKOmI/lIDIYDp5I3ix
	 TgOE6OxTctd1V2qVpAVrb2M7s5isRwoPCKA/WiopmdFQTGV2zpXMU0m2m7SQmwkJu/8rV
	 ODZZjly0TAaVMVLKiTdhjE3AZg4QYspFveQEAPLcPI0vD7Th+8Xsj/EI+DLHGh2dSdMMV
	 ZU0pdZHYuPmg7RjvIjJuAEV1oIePyAXwTmTt5G4HvUSrVIQYW2HuMuv0wC+yidXt7TzW6
	 fkIv+pYmxWQL2POB+y81L9m4ggeUNmOedwTSgyxBdH63PCStMHCYhVkLy0LJnVtSUqg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796397117;
	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=jDlb0mnhaflLk77aULzhoOnE7HtjK3JF1HgTy7ULxyY=;
	b=RJBuRzI+VDJ06XFUlAv48cRRm4GD43hCzKbxxOsjOCvxMNyBSYF3heCpmiEtAEyKzsqK
	 Bn4kU0EtSgvl0LznGI4+g9BDdlUr4a2V1GLf3sathyntowPHXEiU7/gHwUkNMe/0oNvfd
	 hiDMOa0o8v/vmWiXJ0Qppl+vKdjg4+YuBhjVDv6w5jXmGpo4Znp4mrCc9rJJmwunpet0p
	 iQ+tZRefqMtZQ1mgIQZxweH1JDsUjLo4BqCzxwl4ljqEg/T9Irjtw7UQhlflG7GPh2E2f
	 0SzghG8AGiHwoYtA4lxj6RY9LIpTC5hP5cfgrCAkZV/+g8P/kZyu0Se5zh47g7vY+dQ==
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=OmWmdoEd;
	arc=none smtp.remote-ip=209.85.214.174
X-Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174])
	(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 1C659606A32F
	for <netdev@vger.kernel.org>; Fri,  4 Dec 2026 15:11:57 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1C659606A32F
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-pl1-f174.google.com with SMTP id d9443c01a7336-2f03eeda984so6441005ad.2
        for <netdev@vger.kernel.org>; Fri, 04 Dec 2026 07:11:57 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1796397116; x=1797001916; 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=jDlb0mnhaflLk77aULzhoOnE7HtjK3JF1HgTy7ULxyY=;
        b=OmWmdoEd87o8BzoE2KNyh40CfzVOS+jj1K1cOqk4ZScytUs9FhUIKbRxeBwLFXY54l
         awIuBYX3B58NCkomQaUagH7ycZc3alDKeqAjhcpF1MOQjfLI2d6I8J1MidsWcCZh/qQx
         4JNU78R/u4T6O4E0D3q6VpSeFCZVw62htRnwdJMT5HNxqk9ts7/ZdfEBeAvS37RuheZq
         hZhNG4TFLE7o3WweyOMHA8G1mDxSqznVyzlVU1Ri3N7kU3bS0p05S/6BMnjeiKO88ycJ
         zN4+y7MygXC2XkNmckiWTEfpifOcqEzZoqtvWRimpZeD5czT4d6Olxa/Frsa7zTzXfMM
         dHTQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1796397116; x=1797001916;
        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=jDlb0mnhaflLk77aULzhoOnE7HtjK3JF1HgTy7ULxyY=;
        b=0hZE+eslL/WyaxuGsN4QERTLVLV9NQtwwApZsAg9hcetX7iSkyzeOIYGUjJK6HVwJK
         OZC7Zp6o22W90z2kNkwYNpMWTpwDzw4UVd/hLsodaE23m41AykTjVhKdhJYiTqeFvb/S
         QAXNUcXiuYX+oYzOFloLyIY6ZVDt+2MQvqwtcVecJGj3exWtUQuZD/Cvi1F7VJIvJ/D7
         XAyR3jp4zTC8QLjgH5XaAdvMEXZhiYaLn/pLVFkZtGeFK419mc5uvfnvgJiW+3FBKwZO
         4J98gumQkI56NxckElDoenVv8SdzibPR+9HVQSRuStPRnUB5gzdsGsnWKVGp9h/oyLze
         JcEg==
X-Forwarded-Encrypted: i=1; AL+hErGkTka59ygUMti2b8HKXchkJdmsxGxibtgDGjc9Xf/XjcM1AIqpJkeuD1PM3cwxLpndh7XWHnY=@vger.kernel.org
X-Gm-Message-State: AB4q+uFx9dvIFuQxc0JzQZ3FyWr6SanDf3ycn/QaDF4D4VhN662DMXV/
	d4mAN2Rgc+eL3I1AhKd/LuTV1wBFETCNt8tcIuiYWEKDl1P0QACULYcT
X-Gm-Gg: AZFdTZf7WCnFaKbdqBvrtrCVKNi8zOClT2XTcOBh4yabTNu20altkHry82nVPwpLvqc
	ziuLJY95rCxWvAhQdM7EqdX7HlBNqiedvKJmeaSYd81gDg1qzw2vHzy+6x4HOsSrQaO7GDVLGzZ
	HYeLOvnkBJejN2IB3Q9vpIdqbaOINoINbWQQwinST1eS8OeGAbJU0Rq8qQq8BDOBrowL8SO6JGt
	vxVE1BhnYobb/baMDTnDP/sr5Ej1MVNjH66eMtF2uq/Nee2UDlM5HfT7Oh5joek4qPQUMjNt53z
	Ro8afIk6Ii8DzOwJWAXjgVGQ3SkEjGvymbDBtC8FfgErAKWTp2G0q4vf5eCOqLs6uZOZFFH+Sg5
	EFEU6Bnn8UX6Wt6iuFJoymfwEM6V1TxzREuP7DlxMNsfC3ZkZ5p2Exm6MGS2mqj0Cou7mi+AV5w
	HKUVSXOVGHPchm6pIAjCfpkI/lvAUw2oU+ttQ2dZrN8ng0N42g9+G9QynOpa2UedrY4Orzrx0X7
	0ZIjXA6CZwaZnkQiYdEPTqViTBOQNrbAxlUUBF4xuf2z3ZnjZucn7cYwmy0RYocEz12uUptfoO2
	NY7dA8+hoaeRyTwCHr1IbNHXL8KW
X-Received: by 2002:a17:902:ea01:b0:2e4:b37a:d577 with SMTP id d9443c01a7336-2f1ba1e4332mr21589685ad.43.1796397115939;
        Fri, 04 Dec 2026 07:11:55 -0800 (PST)
X-Received: from dbg-srv ([111.194.74.218])
        by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f1b7964777sm14078995ad.67.2026.12.04.07.11.51
        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
        Fri, 04 Dec 2026 07:11:55 -0800 (PST)
X-Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowangio@gmail.com>,
	Eugenio PΓ©rez <eperezma@redhat.com>,
	Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	kvm@vger.kernel.org,
	virtualization@lists.linux.dev,
	netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Jia Jia <physicalmtea@gmail.com>
X-Mailer: git-send-email 2.53.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