posix-fadv-willneed · shipping · also FADV_WILLNEED

POSIX_FADV_WILLNEED

POSIX_FADV_WILLNEED is file-access advice announcing that an application expects to read a specified range soon.

Related Observatory article: POSIX_FADV_WILLNEED on hesela.com

Linux uses this hint to initiate page-cache prefetch, but memory pressure can reduce the amount fetched. The advice is nonbinding; a zero result is not a count of resident bytes. posix_fadvise returns an error number directly on failure. [1]

In Linux v6.17, generic_fadvise invokes force_page_cache_readahead; it can also accept and ignore advice for DAX or a noop backing device. Filesystems may override the generic implementation. [2]

Hesela's three-call invalid-descriptor probe illustrates the differing error channels of posix_fadvise, readahead and preadv2. It is not a prefetch or filesystem-support benchmark. [3]

Relations

related
readahead, rwf-nowait, page-cache, buffered-io, posix-fadv-dontneed, dax

Limitations

Citations

  1. Linux man-pages 6.19: posix_fadvise(2), advice and return conventions (accessed 2026-10-17)
  2. Linux v6.17: generic_fadvise and filesystem-specific dispatch (accessed 2026-10-17)
  3. Hesela: invalid-descriptor API observations, environment and source hashes (accessed 2026-10-17)

JSON: /data/terms/posix-fadv-willneed.json