> The virtio-vsock RX worker currently looks up the socket and takes its > lock for every packet. Keep the socket lock and lookup reference across a > bounded run of STREAM/RW packets for the same established socket. > > Reuse the locked socket while packets continue to match the same flow. > End the batch for a different flow, non-RW traffic, malformed packets, or > a change in socket state, transport, protocol, or receive-buffer headroom. > A connected-table miss uses the existing receive path. > > The reused path still traces every packet, takes an skb owner reference, > validates the source and transport, updates credit, and runs the existing > receive state machine. > > Sockmap can replace the protocol without taking the socket lock. Check the > psock marker at each packet boundary and serialize initial admission with > sk_callback_lock, so a concurrent attach ends batching at the next packet. > > Cap a batch at 64 packets and 64K of payload. The packet limit bounds > per-packet work, while the byte limit bounds how much data can queue before > a reader acquires the socket lock. Batching remains in the process-context > RX worker. > > Signed-off-by: Jia Jia <[email protected]>
Sashiko has reviewed this patch and found no issues. It looks great! -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=2
