{
  "slug": "posix-fadv-willneed",
  "term": "POSIX_FADV_WILLNEED",
  "aliases": [
    "FADV_WILLNEED"
  ],
  "definition": "POSIX_FADV_WILLNEED is file-access advice announcing that an application expects to read a specified range soon.",
  "note": "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. [fadvise-api]\n\nIn 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. [fadvise-617]\n\nHesela'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. [hesela-probe]",
  "advantages": [],
  "limitations": [
    {
      "text": "Prefetch advice does not pin the requested data in memory or promise a faster subsequent read.",
      "citationIds": [
        "fadvise-api"
      ]
    }
  ],
  "related": [
    "readahead",
    "rwf-nowait",
    "page-cache",
    "buffered-io",
    "posix-fadv-dontneed",
    "dax"
  ],
  "citations": [
    {
      "id": "fadvise-api",
      "title": "Linux man-pages 6.19: posix_fadvise(2), advice and return conventions",
      "url": "https://man7.org/linux/man-pages/man2/posix_fadvise.2.html",
      "accessed": "2026-10-17"
    },
    {
      "id": "fadvise-617",
      "title": "Linux v6.17: generic_fadvise and filesystem-specific dispatch",
      "url": "https://raw.githubusercontent.com/torvalds/linux/v6.17/mm/fadvise.c",
      "accessed": "2026-10-17"
    },
    {
      "id": "hesela-probe",
      "title": "Hesela: invalid-descriptor API observations, environment and source hashes",
      "url": "https://hesela.dev/research/prefetch-errors/result.json",
      "accessed": "2026-10-17"
    }
  ],
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-17"
}
