On Thu, Apr 02, 2026 at 01:49:18PM -0700, Laurence Rowe wrote:
A common pattern in epoll network servers is to eagerly accept all
pending connections from the non-blocking listening socket after
epoll_wait indicates the socket is ready by calling accept in a loop
until EAGAIN is returned indicating that the backlog is empty.

Scheduling a timeout for a non-blocking accept with an empty backlog
meant AF_VSOCK sockets used by epoll network servers incurred hundreds
of microseconds of additional latency per accept loop compared to
AF_INET or AF_UNIX sockets.

Signed-off-by: Laurence Rowe <[email protected]>
Reviewed-by: Bobby Eshleman <[email protected]>
---

Patch v2 with feedback from Stefano Garzarella and Bobby Eshleman:

- Move prepare_to_wait before release_sock to match previous behaviour.

- Simplify not connected case.

Thanks for addressing them, now LGTM!

Reviewed-by: Stefano Garzarella <[email protected]>


Reply via email to