buffered-io · shipping

Buffered I/O

Buffered I/O is file access through an operating-system cache, allowing transfers between an application and storage to be decoupled.

Related Observatory article: Read on hesela.com

For Linux iomap, buffered reads use page-cache folios and buffered writes dirty them for later writeback. This is distinct from a language runtime's stream buffer or an SSD's device cache. [1]

Writeback thresholds decide when dirty cache pages reach storage. In Linux v6.16 the defaults start background writeback at 10% of available memory and make writing processes start writeback themselves at 20%. The default periodic wakeup interval is 5 s, and 30 s is the dirty-age threshold for eligibility for writeout, not a durable-completion deadline. [2] [3]

The percentages apply to available memory, meaning free plus reclaimable pages, not total system memory. Setting the wakeup interval to zero disables periodic writeback altogether. [2]

Disabling periodic wakeups does not disable every writeback trigger or make dirty data persistent. For a completion requirement, check the result of the appropriate synchronization operation, such as fsync(); syncing a file does not by itself synchronize its directory entry. [2] [4]

Relations

related
Page cache, Direct I/O, Write-back cache, fsync, POSIX_FADV_NOREUSE, POSIX_FADV_DONTNEED, RWF_DONTCACHE, RWF_NOWAIT, POSIX_FADV_WILLNEED, readahead (Linux syscall), FUSE, WSBuffer, Linux writeback throttling, Data sieving

Advantages

  • Allows cache reuse and writeback rather than requiring every application transfer to reach storage immediately. [1]
  • Many small application writes can be absorbed in memory and written out later by background flusher threads. [2]

Limitations

  • Successful buffer updates alone are not persistence evidence; mixing access paths can require coherence work. [1]

Citations

  1. Linux v6.17: iomap supported file operations, sections 2.2.1-2.2.3. (accessed 2026-10-14)
  2. Linux v6.16 documentation: /proc/sys/vm, dirty_background_ratio, dirty_ratio, dirty_expire_centisecs and dirty_writeback_centisecs (accessed 2026-11-05)
  3. Linux v6.16 mm/page-writeback.c: default dirty ratios and writeback intervals (accessed 2026-11-05)
  4. Linux man-pages: fsync(2), completion, return value and directory-entry scope (accessed 2026-11-05)
Sources & caveats
  • vm-sysctl is the Linux v6.16 vm sysctl documentation, read on the access date in the dirty_* entries.
  • writeback-src is mm/page-writeback.c at tag v6.16, read for the default values of the four tunables.
  • 10%, 20%, 5 s and 30 s come from writeback-src, where they appear as 10, 20, 5 * 100 and 30 * 100 centiseconds or percent.
  • iomap was not reread and keeps its earlier access date.
  • The 2026-11-05 correction distinguishes dirty-age eligibility, periodic wakeups and synchronization completion; vm-sysctl, writeback-src and fsync-api were reread.

JSON: /data/terms/buffered-io.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Buffered I/O. Hesela. 2026-12-02. https://hesela.dev/terms/buffered-io/