Zero-copy I/O
Zero-copy I/O is a data-transfer technique that avoids one or more payload copies between buffers or address spaces.
The avoided copy and the buffer-reuse boundary depend on the API and path. A sendfile return does not release the caller from keeping referenced source regions unchanged until consumption. [1]
MSG_ZEROCOPY is a separate socket interface with buffer-reuse notifications; these are not transmit-completion notifications, and the kernel can still copy the data. [2]
IO-Lite (OSDI 1999) combined copy avoidance with immutable buffers and mutable buffer aggregates; source stability was part of that design, not a consequence of the term zero-copy. [4]
io_uring SEND_ZC uses completion-ring notifications rather than the socket error queue. F_MORE on the initial send result requires retaining the payload until the matching F_NOTIF notification, including after a send error. Neither notification proves remote receipt or persistence. [5]
Relations
- related
- sendfile, splice, Page cache, Direct I/O, tee (Linux system call), io_uring zero-copy send, zicIO
Citations
- Linux man-pages 6.19: sendfile(2), return value and source lifetime
- Linux kernel documentation: MSG_ZEROCOPY, notifications and deferred copies
- Pai, Druschel and Zwaenepoel: IO-Lite, OSDI 1999, sections 2.1, 2.5, 2.9 and 3
- liburing 2.11: io_uring_enter(2), SEND_ZC results and notification lifetime