mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jia Jia <physicalmtea@gmail.com>
To: Stefano Garzarella <sgarzare@redhat.com>,
	Bobby Eshleman <bobbyeshleman@gmail.com>
Cc: "Michael S . Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowangio@gmail.com>,
	"Eugenio Pérez" <eperezma@redhat.com>,
	"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Mathieu Desnoyers" <mathieu.desnoyers@efficios.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>,
	virtualization@lists.linux.dev, kvm@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org
Subject: [PATCH net-next v6 0/2] vsock/virtio: reduce RX per-packet socket overhead
Date: Fri, 27 Nov 2026 06:26:58 +0000	[thread overview]
Message-ID: <20261127062700.29387-1-physicalmtea@gmail.com> (raw)

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 native 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.5175      6.3239  +79.78% [+72.79%, +87.06%]
  8K           4.1183      5.6867  +38.08% [+31.06%, +45.48%]
  16K          5.0155      6.8346  +36.27% [+31.12%, +41.62%]
  64K          5.0541      5.8403  +15.56% [+11.12%, +20.17%]

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           2.9234      6.3365  +116.75% [+110.78%, +122.89%]
       recv() calls (baseline/series): 538537/525565
  8K           4.0430      7.1193  +76.09% [+69.04%, +83.44%]
       recv() calls (baseline/series): 276901/264412
  16K          4.9182      7.7688  +57.96% [+54.40%, +61.60%]
       recv() calls (baseline/series): 147674/132088
  64K          5.6683      7.1636  +26.38% [+20.49%, +32.56%]
       recv() calls (baseline/series): 50615/33343

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.

Changes since v5:

- 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                  |  23 ++
 .../events/vsock_virtio_transport_common.h    |  40 +-
 net/vmw_vsock/virtio_transport.c              |   7 +-
 net/vmw_vsock/virtio_transport_common.c       | 368 +++++++++++++++---
 4 files changed, 359 insertions(+), 79 deletions(-)


base-commit: 8df0638138d3e0344fd1fb36cf2d1ca1cf5028f0
-- 
2.53.0

             reply	other threads:[~2026-11-27  6:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27  6:26 Jia Jia [this message]
2026-11-27  6:26 ` [PATCH net-next v6 1/2] vsock/virtio: split socket lookup from locked RX processing Jia Jia
2026-11-27  6:27 ` [PATCH net-next v6 2/2] vsock/virtio: amortize RX socket locking for stream packets Jia Jia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261127062700.29387-1-physicalmtea@gmail.com \
    --to=physicalmtea@gmail.com \
    --cc=bobbyeshleman@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=eperezma@redhat.com \
    --cc=horms@kernel.org \
    --cc=jasowangio@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®