> The virtio-vsock RX worker looks up a socket and takes its lock for every > packet. Retain the connected lookup reference and socket lock across a > bounded run of STREAM/RW packets for one established native socket. > > Reuse the locked socket while packets match the same flow. Finish the > batch on a malformed packet, flow change, non-RW traffic, or a change to > the socket state, transport, protocol, sockmap state, or receive buffer > limits. A connected lookup miss falls back to the existing receive path, > which can still find a bound socket. > > Limit an uninterrupted socket-lock ownership interval to 64 packets and > 64 KiB of payload. The payload limit is one > VIRTIO_VSOCK_MAX_PKT_BUF_SIZE. Small or zero-length packets still incur > per-packet work, so an independent packet limit is needed. The 64-packet > limit uses VHOST_NET_BATCH as a reference; it is a policy choice rather > [ ... ] > 8K 1.702 1.667 -2.06% [ -7.99%, +4.25%] > 16K 1.473 1.475 +0.17% [ -5.06%, +5.68%] > 64K 1.385 1.358 -1.96% [-10.61%, +7.53%] > > Signed-off-by: Jia Jia <[email protected]>
Sashiko has reviewed this patch and found no issues. -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=3
