posix-fadv-random · shipping · also FADV_RANDOM

POSIX_FADV_RANDOM

POSIX_FADV_RANDOM is a file-access hint indicating that an application expects to access the specified data in random order.

Related Observatory article: POSIX_FADV_RANDOM on hesela.com

Linux applies this policy through the advised handle across the file, not only within the supplied byte range. Advice is nonbinding; a successful call does not report fetched bytes. [1]

In Linux v6.14 generic_fadvise, RANDOM sets FMODE_RANDOM without changing the saved readahead budget or FMODE_NOREUSE. WILLNEED remains a separate explicit prefetch path. Filesystem-specific handlers and DAX/noop cases can differ. [2]

The implementation stores policy on struct file. Duplicated descriptors share this open file description; independently opening the same file creates separate policy state, not a separate file cache. [2] [3]

Relations

related
POSIX_FADV_SEQUENTIAL, POSIX_FADV_NOREUSE, POSIX_FADV_WILLNEED, readahead (Linux syscall), Open file description, Page cache

Advantages

  • Expresses a random-access expectation without requiring direct I/O.

Limitations

  • Does not evict cached data, establish durability or forbid explicit prefetch.

Citations

  1. Linux man-pages: posix_fadvise(2), advice and Linux whole-file scope. (accessed 2026-10-23)
  2. Linux v6.14 mm/fadvise.c: generic_fadvise policy transitions and overrides. (accessed 2026-10-23)
  3. Linux man-pages: open(2), open file descriptions and duplicated descriptors. (accessed 2026-10-23)
Sources & caveats
  • Source review of Linux v6.14 generic advice behavior; not a native experiment or benchmark.

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

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. POSIX_FADV_RANDOM. Hesela. 2026-10-23. https://hesela.dev/terms/posix-fadv-random/