{
  "slug": "rwf-dontcache",
  "term": "RWF_DONTCACHE",
  "aliases": [
    "uncached buffered I/O",
    "buffered I/O drop-behind"
  ],
  "definition": "RWF_DONTCACHE is a Linux per-operation flag requesting best-effort removal of page-cache content newly instantiated by a buffered read or write.",
  "note": "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. [rwf-api] 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. [dropbehind-source]\n\nIn 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. [dropbehind-source]\n\nThe 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. [nfsd-vfs-72]",
  "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."
  ],
  "related": [
    "buffered-io",
    "page-cache",
    "direct-io",
    "posix-fadv-noreuse",
    "posix-fadv-dontneed",
    "fsync",
    "nfs-storage"
  ],
  "citations": [
    {
      "id": "rwf-api",
      "label": "readv(2)",
      "title": "Linux man-pages 6.19: readv(2), RWF_DONTCACHE and RWF_DSYNC/RWF_SYNC.",
      "url": "https://man7.org/linux/man-pages/man2/readv.2.html",
      "accessed": "2026-10-15"
    },
    {
      "id": "dropbehind-source",
      "label": "Linux v6.14 filemap",
      "title": "Linux v6.14 mm/filemap.c: filemap_read and drop-behind read completion.",
      "url": "https://github.com/torvalds/linux/blob/v6.14/mm/filemap.c",
      "accessed": "2026-11-09"
    },
    {
      "id": "hesela-cache-advice",
      "title": "Hesela: O_DIRECT alignment and shared page-cache advice",
      "url": "https://hesela.com/analyses/o-direct-alignment-by-kernel/#cache-retention-sharing",
      "accessed": "2026-11-09"
    },
    {
      "id": "nfsd-modes-72",
      "title": "Linux v7.2 NFSD IO MODES: experimental server read/write policy and DONTCACHE fallback.",
      "url": "https://docs.kernel.org/7.2/filesystems/nfs/nfsd-io-modes.html",
      "accessed": "2026-11-28"
    },
    {
      "id": "nfsd-vfs-72",
      "title": "Linux v7.2 fs/nfsd/vfs.c: nfsd_iter_read and nfsd_vfs_write capability checks.",
      "url": "https://github.com/torvalds/linux/blob/v7.2/fs/nfsd/vfs.c",
      "accessed": "2026-11-28"
    }
  ],
  "status": "shipping",
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-28",
  "provenance": [
    "NFSD supplement: source review pinned to Linux v7.2, not a feature-introduction date, server benchmark or cache-residency measurement."
  ]
}
