posix-fadv-dontneed · shipping · also FADV_DONTNEED

POSIX_FADV_DONTNEED

POSIX_FADV_DONTNEED is a file-access advice value requesting release of cached data that the application does not expect to access soon.

Related Observatory article: Read on hesela.com

Unwritten dirty pages are not freed, and partial pages are generally retained. The v6.14 generic implementation additionally permits the final partial page when the advised inclusive end is the last file byte; filesystem-specific implementations may differ. [1] [2] A successful call does not prove eviction or durable completion; posix_fadvise returns an error number directly on failure. [1]

The v6.14 generic path invalidates a range of the file's shared mapping, without selecting which open file description populated it. A separate open of the same regular file does not isolate eligible cached data from this advice. Unlike RWF_DONTCACHE, the range can include data cached before the caller's transfer. [2]

Relations

related
posix_fadvise, Buffered I/O, Page cache, POSIX_FADV_NOREUSE, RWF_DONTCACHE, fsync, POSIX_FADV_WILLNEED

Advantages

  • Targets a file range rather than dropping system-wide caches.

Limitations

  • Eviction remains best effort and concurrent access can repopulate the cache.

Citations

  1. Linux man-pages 6.19: posix_fadvise(2), advice semantics and return values. (accessed 2026-10-15)
  2. Linux v6.14 mm/fadvise.c: generic_fadvise, including the end-of-file partial-page exception. (accessed 2026-11-09)

Further reading

  1. Hesela: O_DIRECT alignment and shared page-cache advice (accessed 2026-11-09)

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

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. POSIX_FADV_DONTNEED. Hesela. 2026-11-11. https://hesela.dev/terms/posix-fadv-dontneed/