rwf-nowait · shipping · also preadv2 NOWAIT

RWF_NOWAIT

RWF_NOWAIT is a per-operation Linux I/O flag requesting that supported operations avoid waiting for unavailable data or contended resources.

Related Observatory article: Read on hesela.com

With preadv2 since Linux 4.14, this flag can return a short positive byte count; no progress because waiting would be needed yields -1 with errno EAGAIN. Linux 5.9 and 5.10 have a documented premature-zero-return bug. [1]

In Linux v6.17, missing FMODE_NOWAIT support yields EOPNOTSUPP. The generic buffered-read path distinguishes IOCB_NOWAIT from IOCB_NOIO and can initiate readahead before returning EAGAIN. Thus EAGAIN neither identifies a cache miss uniquely nor proves that no storage I/O was started. [2] [3]

Other APIs report completion differently: io_submit uses -EAGAIN in the event's res field for a NOWAIT operation that would block. [4]

Relations

related
Buffered I/O, Page cache, Direct I/O, POSIX_FADV_WILLNEED, readahead (Linux syscall), io_uring, io_uring completion queue entry, splice, RWF_HIPRI

Limitations

  • A caller must handle partial progress and choose a retry or fallback policy rather than treating every nonnegative return as a complete read. [1]

Citations

  1. Linux man-pages 6.19: readv(2), RWF_NOWAIT and return-value caveats (accessed 2026-10-17)
  2. Linux v6.17: kiocb_set_rw_flags and FMODE_NOWAIT (accessed 2026-10-17)
  3. Linux v6.17: filemap_get_pages and filemap_readahead (accessed 2026-10-17)
  4. Linux man-pages 6.19: io_submit(2), aio_rw_flags and completion results (accessed 2026-10-17)
Sources & caveats
  • The detailed buffered-path description is pinned to Linux v6.17; it is not a hard wall-clock latency guarantee for every filesystem or environment.

JSON: /data/terms/rwf-nowait.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. RWF_NOWAIT. Hesela. 2026-11-10. https://hesela.dev/terms/rwf-nowait/