readahead · shipping · also readahead(2)

readahead (Linux syscall)

The Linux readahead syscall requests advance loading of a file range into the page cache without advancing the open file description's offset.

Related Observatory article: readahead (Linux syscall) on hesela.com

Ranges are handled in whole pages and stop at end of file. Success returns zero, not a fetched-byte count; errors return -1 and set errno. Subsequent reads benefit only if data arrives in time and remains cached. [1]

The call may block while locating blocks through filesystem metadata, including the documented ext2/ext3/ext4 indirect-block case. Background data reads therefore do not establish a hard nonblocking-call guarantee. [1]

Relations

related
posix-fadv-willneed, rwf-nowait, page-cache, buffered-io

Limitations

Citations

  1. Linux man-pages 6.19: readahead(2), ranges, return values and metadata blocking (accessed 2026-10-17)

JSON: /data/terms/readahead.json