]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
vsock: avoid timeout for non-blocking accept() with empty backlog
authorLaurence Rowe <laurencerowe@gmail.com>
Thu, 2 Apr 2026 20:49:18 +0000 (13:49 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 7 Apr 2026 01:29:01 +0000 (18:29 -0700)
commit98f28d8d6e5a5ed058dd37854c19e9b3bae72eff
tree7e5f15a43efa854a405bdcf30e9ee1c113f609e8
parentc8eee00c0fef5f709b9114be432d7b3afebb4c0a
vsock: avoid timeout for non-blocking accept() with empty backlog

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 <laurencerowe@gmail.com>
Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20260402204918.130395-1-laurencerowe@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/vmw_vsock/af_vsock.c