Multiplexed I/O

Onload User Guide (UG1586)

Document ID
UG1586
Release Date
2023-07-31
Revision
1.2 English

Linux supports three common methods for handling multiplexed I/O operation; poll(), select() and the epoll set of functions.

The general behavior of the poll(), select() and epoll_wait() functions with Onload is as follows:

  • If there are operations ready on any file descriptors, poll(), select() and epoll_wait() will return immediately. Refer to Poll, ppoll, Select, pselect and Epoll for specific behavior details.
  • If there are no file descriptors ready and spinning is not enabled, calls to poll(), select() and epoll_wait() will enter the kernel and block.
  • In the cases of poll()and select(), when the set contains file descriptors that are not accelerated sockets, there is a slight latency overhead as Onload must make a system call to determine the readiness of these sockets. There is no such cost when using epoll_wait() and a system call is only needed when non-Onload descriptors become ready.

    To ensure that non-accelerated (kernel) file descriptors are checked when there are no events ready on accelerated (onload) descriptors, disable the following options:

    • EF_SELECT_FAST and EF_POLL_FAST - setting both to zero.
    • EF_POLL_FAST_USEC and EF_SELECT_FAST_USEC - setting both to zero.
  • If there are no file descriptors ready and spinning is enabled, Onload will spin to ensure that accelerated sockets are polled a specified number of times before unaccelerated sockets are examined. This reduces the overhead incurred when Onload has to call into the kernel and reduces latency on accelerated sockets.

The following subsections discuss the use of these I/O functions and Onload environment variables that can be used to manipulate behavior of the I/O operation.