> From: Jia Jia <[email protected]> > > The virtio-vsock RX worker currently acquires and releases the socket lock > for every received packet. Keep the lock held while processing a bounded > run of packets that belongs to the same socket. > > Only ordinary RW packets for an established STREAM socket whose transport > and protocol remain unchanged are eligible. Control packets, SEQPACKET > traffic, state or transport changes, malformed packets, and sockets whose > protocol has been replaced end the active batch and retain their existing > handling. > > Serialize the initial eligibility check with sk_callback_lock because > sockmap removal restores the protocol without taking the socket lock. > > Limit each batch to 64 packets or 64K of payload to bound the work > performed under one socket lock. Keep the lookup reference until the batch > finishes. > > The virtqueue callback remains a queue_work() callback. Batching runs only > in the process-context RX worker. > > Introduce virtio_transport_rx_batch_finish() to tear down the batch and > release the socket lock and lookup reference. > > 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
