rwf-dontcache · shipping · also uncached buffered I/O, buffered I/O drop-behind

RWF_DONTCACHE

RWF_DONTCACHE is a Linux per-operation flag requesting best-effort removal of page-cache content newly instantiated by a buffered read or write.

Related Observatory article: Read on hesela.com

The flag is documented since Linux 6.14; previously cached ranges are not pruned by the hint, and unsupported targets report EOPNOTSUPP. Writes initiate writeback, which is not a durability guarantee. [1] The v6.14 filemap_read path still copies cached folios to the caller before attempting drop-behind; this is not O_DIRECT or proof of zero-copy transfer. [2]

In Linux v6.14, __filemap_get_folio() clears an existing drop-behind mark when the lookup lacks FGP_DONTCACHE. The buffered-read cleanup path skips dirty or writeback folios and only attempts invalidation after acquiring a nonblocking folio lock. These shared-cache implementation conditions do not promise that another access will keep a folio resident. [2]

The userspace error contract differs from Linux v7.2 NFSD's server DONTCACHE policy: without FOP_DONTCACHE, NFSD continues through buffered I/O without adding the drop-behind flag. Do not infer an NFS server error from the userspace EOPNOTSUPP rule, or successful eviction from the server setting. [5]

Relations

related
Buffered I/O, Page cache, Direct I/O, POSIX_FADV_NOREUSE, POSIX_FADV_DONTNEED, fsync, NFS

Advantages

  • Can limit cache retention for one-pass buffered access while retaining already cached ranges.

Limitations

  • No hard guarantee of final cache state, durable completion or improved throughput.

Citations

  1. Linux man-pages 6.19: readv(2), RWF_DONTCACHE and RWF_DSYNC/RWF_SYNC. (accessed 2026-10-15)
  2. Linux v6.14 mm/filemap.c: filemap_read and drop-behind read completion. (accessed 2026-11-09)
  3. Linux v7.2 fs/nfsd/vfs.c: nfsd_iter_read and nfsd_vfs_write capability checks. (accessed 2026-11-28)

Further reading

  1. Hesela: O_DIRECT alignment and shared page-cache advice (accessed 2026-11-09)
  2. Linux v7.2 NFSD IO MODES: experimental server read/write policy and DONTCACHE fallback. (accessed 2026-11-28)
Sources & caveats
  • NFSD supplement: source review pinned to Linux v7.2, not a feature-introduction date, server benchmark or cache-residency measurement.

JSON: /data/terms/rwf-dontcache.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. RWF_DONTCACHE. Hesela. 2026-11-28. https://hesela.dev/terms/rwf-dontcache/